Live data from Hacker News

Pointless

ptls.dev

31–37 of 37 posts

Re: Pointless

#31
Wondering how pointless differed from Haskell, I looked up the syntax for composition and found

  compose(a, b) = x => a(b(x))
It's indeed more pointless than Haskell:-)

Btw, the `x' in that definition is the `point' from which the name originates.

Re: Pointless

#32

Reminds me of LiveScript. Nowadays, you might be able to achieve something similar with JS + a bunch of Babel plugins, like pipeline operator and so.

Yes! LiveScript was so fun! I’m pretty sad none of the JS dialects from that time (CoffeeScript, ICS, Coco, LiveScript...) could hold a candle for how much TypeScript improves the experience; or that none could integrate it in a sensible fashion.

Re: Pointless

#33

This is pretty cool. After reading half the examples, I started wondering "wait what are you doing with the output variable", and then it clicked and I checked the docs, and yep, outputting to stdout is done by assignment to a magic `output` variable. A very interesting/novel approach to things.

Classic BASIC implementation picked up on this idea. For instance some dialects had an INKEY$ variable which looks like a string, but magically reads console input. GNU Bash has a magic variable RANDOM that produces random numbers. Assignments to it appear to be ignored. In Algol, the name of the enclosing function acts as a variable to which you assign in order to produce the return value. For instance, see the assi…

> GNU Bash has a magic variable RANDOM that produces random numbers. Assignments to it appear to be ignored.

Assignments are used to seed¹ the random number generator². This isn't limited to just bash/zsh/etc, it is intrinsic to the process of generating random numbers. Being aware of this is useful as it poses a significant footgun. The /dev/random docs³ provide a nice overview of how it is often handled on various systems at the OS level to deal with reboots.

An example of the fun that this can produce can be seen in a Debian bug⁴, running a script that uses subshells and RANDOM with bash will behave very differently when using zsh. In this instance you have to hope that subshells aren't being used to create unique logs as an example.

1. https://en.m.wikipedia.org/wiki/Random_seed

2. https://en.m.wikipedia.org/wiki/Random_number_generator

3. https://en.m.wikipedia.org/wiki//dev/random

4. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=828180

Re: Pointless

#34

How would you describe the difference between an Object and a Map in Pointless? Having read the documentation, I don't see any difference other than whether non-string keys are allowed, and as a result the syntax for value access (`obj.key` vs `map["key"]`). And one of the things I've been wondering about with regard to language design is why more languages don't take a Clojure-like approach of fully merging the conc…

Hello, I'm the author of this project: Pointless originally had a static type-system, which I later ditched (the type-system was pretty experimental, and I never got it working to my liking). So the object / map division is a holdover from that. I'll probably keep them separate for now to leave the option of static typing open, but I agree that it's a bit redundant for now. The only remaining technical differences ar…

It would be worth actually including that information about your type system in the docs. There's no mention of the language being statically or dynamically typed - which is a shame, because a scripting language with a static type system from the get-go would be novel in itself.

Re: Pointless

#35

How would you describe the difference between an Object and a Map in Pointless? Having read the documentation, I don't see any difference other than whether non-string keys are allowed, and as a result the syntax for value access (`obj.key` vs `map["key"]`). And one of the things I've been wondering about with regard to language design is why more languages don't take a Clojure-like approach of fully merging the conc…

Hello, I'm the author of this project: Pointless originally had a static type-system, which I later ditched (the type-system was pretty experimental, and I never got it working to my liking). So the object / map division is a holdover from that. I'll probably keep them separate for now to leave the option of static typing open, but I agree that it's a bit redundant for now. The only remaining technical differences ar…

thanks for the response!

to follow up on this, does this mean that Pointless actually allows inheritance and polymorphic dispatch? Because clearly functions are first class, so they could easily be values in a map just like they could live in an object.

Re: Pointless

#36
post #13

I guess I'll be the first to mention how clever the name is.

Could you elaborate? I thought the name was a reference to a "point-free style" of piping commands. But maybe I am missing something more obvious?

Yes, was hoping to see more point-free examples

Re: Pointless

#37

This is pretty cool. After reading half the examples, I started wondering "wait what are you doing with the output variable", and then it clicked and I checked the docs, and yep, outputting to stdout is done by assignment to a magic `output` variable. A very interesting/novel approach to things.

Classic BASIC implementation picked up on this idea. For instance some dialects had an INKEY$ variable which looks like a string, but magically reads console input. GNU Bash has a magic variable RANDOM that produces random numbers. Assignments to it appear to be ignored. In Algol, the name of the enclosing function acts as a variable to which you assign in order to produce the return value. For instance, see the assi…

I remember from GW-BASIC there being, ERR, ERL, CSRLIN, and probably a few others. C64 BASIC V2.0 had ST and TI/TI$.

BASIC's version of $RANDOM is RND(x), and I remember that the sign of the argument was the most important thing. Negative values seeded the PRNG and any positive argument got you the next random number. Some later dialects had a RANDOMIZE statement.

The funny thing is BASIC also had a couple functions that took input variables, but didn't do anything with them, like POS() and FRE(). I think FRE's argument may have been significant on a couple BASICs.

Post reply on HN