Live data from Hacker News

Pointless

ptls.dev

11–20 of 37 posts

Re: Pointless

#11

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 assignment to B in the nested function here;

https://en.wikipedia.org/wiki/Man_or_boy_test

Re: Pointless

#14

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…

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 

Re: Pointless

#15

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.

Anyone remember the SNOBOL set of languages?

When I was in high school, I stumbled across the source code for cc on the UIC mainframe. Part of it was in either Snobol or Spitbol (I don't remember now) and I remember going to the library to get a book on the language to learn enough to be able to decipher the code.

Re: Pointless

#18

Earlier quoted context omitted.

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…

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

Re: Pointless

#19

f# and .fsx/fsi scripting

I'm not super familiar with f#, but Pointless definitely takes inspiration from languages in the ML family, while only offering a small subset of their features. One of the questions I want to explore in this project is how programming language design can shape the learning process for beginners, centering on the idea that the features that a language chooses not to include are often key. I was pretty influenced by Mark Seemann's essay [0] on this idea.

[0] https://blog.ploeh.dk/2015/04/13/less-is-more-language-featu...

Re: Pointless

#20

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.

Anyone remember the SNOBOL set of languages?

I used it in CS grad school in the early 70's. I have both books on it, including "The Macro Implementation of SNOBOL4."

I used it to write a go-moku (5-in-a-row) playing program in an AI course and got an A when it beat the professor.

Post reply on HN