top | item 47163757

(no title)

dmit | 4 days ago

Alt opinion: syntax is the least important part of a programming language. I can't wait for the day someone invents one where it's defined entirely as an AST (with the S standing for Semantic). Just bring your own weird syntax.

I guess Unison is the closest to this platonic ideal right now? https://github.com/unisonweb/unison/issues/499

discuss

order

pjmlp|4 days ago

I have an idea, maybe we could represent that AST as parenthesis.

itishappy|4 days ago

That's cool, but I might prefer semantic whitespace. Sure would be neat if we could both work with the same code in our preferred forms.

ocimbote|4 days ago

Honestly, we can do better than LISPs.

Just use curly brackets and boom. LISP 3k.

You're welcome.

itishappy|4 days ago

Love this take! Unison is exactly this, and it's awesome!

Here's a quote from one of the creators:

> But here's the super cool thing about our language! Since we don't store your code in a text/source code representation, and instead as a typechecked AST, we have the freedom to change the surface syntax of the language very easily, which is something we've done several times in the past. We have this unique possibility that other languages don't have, in that we could have more than one "surface syntax" for the language. We could have our current syntax, but also a javascript-like syntax, or a python-like syntax.

https://news.ycombinator.com/item?id=46053304

fuzztester|4 days ago

Can Raku do something like this? I was lightly exploring it recently, and I thought I saw that something like this may be possible with it.

geocar|4 days ago

I completely agree: If it is ugly-as-sin-but-useful I will learn it.

The aesthetic of mathematics as it appears in journals is I think questionable, but undeniably convenient for communication, so it is every language making the case that you (dear reader) can say something very complicated and useful in the ideal amount of space.

"Hello world" isn't that: That's the one program everyone should be able to write correctly, 100% of the time. That's how we can talk about brainfuck as exercise, but APL is serious.

Or put another way, even if seeing a new kind of "hello world" excites dear reader, it's probably not going to excite me, unless it's objectively disgusting.

What Om does here is exactly right for me: It tells me what it is, and makes it easy for me to drill down to each of those things to figure out what the author means by that, and decide if I am convinced.

I mean, that's the point right? I'm here trying to learn something new and that requires I allow myself to be convinced, and since "hello world" is table-stakes, seeing it can only slow my ability to be convinced.

phailhaus|4 days ago

This is a Very Bad Idea. Two people working with the same language will be unable to reason about each other's code, because it requires understanding their bespoke syntax and its nuances.

dmit|4 days ago

No it won't? That's exactly the point -- each of those people will be viewing the code in their own preferred syntax. If there is semantic nuance in the writer's syntax, the reader will see it presented in the best way their preferred syntax's representation can provide.

Imagine all the hours saved that are currently spent on tired tabs vs spaces debates, or manicuring .prettierrc, etc etc. The color of the bike shed might matter (sometimes a lot) to some people, I know, but it's storing bikes away from the elements and thieves that is the goal, not obsessing over optimizing something that is demonstrably a subjective matter of taste.