Live data from Hacker News

Pointless

ptls.dev

21–30 of 37 posts

Re: Pointless

#21
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?

Re: Pointless

#22
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?

Right, point-free style is a classic of functional programming, so to pick "Pointless" for a FP language is nice. One of those obvious-once-you-see-it things.

Re: Pointless

#23
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.

Re: Pointless

#24

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…

Flashback! 7 year old me named my rabbit after the inkey variable.

Re: Pointless

#25
post #7

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…

Possibly because JS did that (it has been a thing since Self I think? Or maybe that was just the prototypal inheritance—I never can remember) and the confusion between the symbolic properties and the key properties kept coming up. Like, you have that x.abc is the same as x["abc"] but then things start to break because many dict objects have a .__proto__ or whatever and so they start to fail in interesting ways when y…

> it has been a thing since Self I think? Or maybe that was just the prototypal inheritance

Just the inheritance.

Re: Pointless

#27
post #5

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.

Haskell is somewhat similar, too! I think some of this comes from C. The goal of a Haskell compiler is to take your code and spit out an executable. That executable is in fact the value named “Main.main,” which must be of the in-Haskell type (translating to English) “a program which produces nothing.” In the source code you are constantly juggling values of type “a program which produces ____” and linking them togeth…

Actually `main` in Haskell can be an IO action returning any type, eg this is a perfectly valid main:

    main :: IO Int
    main = print "10" >> pure 10
the return value is just ignored when it's actually invoked as an executable (but can be used if invoked eg. in the repl, or if main is also called from somewhere deeper in the code).

Re: Pointless

#28

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.

Saw |> in the example and came here to say the same thing! I used LiveScript for a while and it was very fun to use for personal projects.

Re: Pointless

#30

Earlier quoted context omitted.

Stray thought while reading the documentation, inspired by how easy it is to convert a variable to a function: is there any reason to include a separate switch statement at all? It seems like you could use `if` there with a similar syntax: getSignZero(n) = if { n > 0 then Positive n

Similar story as with objects - the switch statement originally existed to facilitate type-aware conditionals for statically checked algebraic data-types. At this point it's just syntactic sugar for a chain of conditionals. It might make sense to unify the two constructs - and I like the syntax you suggest

Or cond. Which is more like what you did. Not if, which is everywhere a binop. switch takes a block with seperate syntax, but cond just a list of expressions and statements.
Post reply on HN