Programming thread

Yes, western music notation doesn't require a fancy editor to read it (and you really don't with Lisp either to read it, it's just that some extenions help), but it already has (most of) the necessary information packed in to it's elaborate, 400+ year old, tested and evolved notation system.
It's kind of funny in a sad sort of way that they went to all that trouble developing that elaborate notation system, when an entire symphonic score can easily be represented as a single well-chosen integer with a certain prime factorization.
 
Yeah, no. I should not ask questions I know the answer to. And I've had my experience with Smalltalk - it's shit, as many novel, revolutionary, academic ideas are.

Besides, writing code as a text is basically creating AST, no? Potatoe, potatoh.
Some people swear by it. Have you looked at new implementations like Squeak and Newspeak?
Writing code as text is meh/10 wrt creating AST. It's true for languages like Lisp, but as far as I see it, it's a question of distance between the representation of the AST and the text. When you write you code, you don't do it in the terms and abstractions of the AST, you do it in whatever way the language defines its syntax, then a lexer and parser take that stream of characters and emit a AST. Why shouldn't the creation of code, because writing might not even be the appropriate term here, be done directly in the terms of the AST? Why should it be text actions and not semantic action, like "add node"? It goes even further than how lisps do it.
Like what? C'mon man, don't make me do the work for you again. Propose something tangible, make a mockup in Paint, whatever.
You're going to have to play make-believe with me for now, sorry
Filesystem is a database.
But not one good for storing ASTs. ASTs belong in a graph database
Or actually try to teach somebody what you're preaching and see how hard it is.
I found that it varies greatly. People think differently, maybe it plays a role
 
When you write you code, you don't do it in the terms and abstractions of the AST, you do it in whatever way the language defines its syntax, then a lexer and parser take that stream of characters and emit a AST. Why shouldn't the creation of code, because writing might not even be the appropriate term here, be done directly in the terms of the AST?
Because the AST is for the compiler, not humans.
The comments, headers, how I format it, having an extra newlines here and there, the file structure, etc. aren't present in the generated AST.

Not to mention the problem with having a special snowflake format, where I lose the huge amount of tools that work with plain-text files and now I need a special snowflake editor, a special snowflake grep, diff, wc, version control, "file" management, etc..
I hate anyone who'd try to force that shit on me.
 
  • Agree
Reactions: Least Concern
Writing an AST for code sounds like the functional-programmer equivalent of singing the praises of writing everything in assembly.
Even if we had could get over the fact that a standard filetype for ASTs would be a lot harder to get standard than standard text files (arrays of bytes), how would you even interact with it? Would you have GUI tree where you click on it to add and remove nodes? It's really easy to imagine a world where we used something that was more advanced than text files, and a whole different thing to actually implement it. Considering I've never seen or used a graphical programming language that was good at anything more than a really specific task, I don't think anything will displace text files.

I guess you could implement everything over Lisp but you'd still be interpreting it. Even if we had Lisp machines, if you're just going to implement monadic types as macros or whatever, why not just make a Haskell machine instead?
 
  • Like
Reactions: Knight of the Rope
Tabs, or spaces? Go!
Both.

comic.GIF
 
The comments, headers, how I format it, having an extra newlines here and there, the file structure, etc. aren't present in the generated AST.
Which is BAD
Why shouldn't comments be metadata attached to the code itself?
Not to mention the problem with having a special snowflake format, where I lose the huge amount of tools that work with plain-text files and now I need a special snowflake editor, a special snowflake grep, diff, wc, version control, "file" management, etc..
you wc your code? lol
Dude, when it's in a database you can do it with fucking queries.
Version control? Just add the time dimension to your database.
 
What we can learn from “_why”, the long lost open source developer

I remember reading his book during a brief period trying to learn Ruby in the '00s. It's kind of excruciating to read if you already know any other programming language and just want to get to the nitty-gritty of Ruby's particularities, but there's no denying it's an entertaining and newbie-friendly read and there's few, if any, other programmers out there who can match that guy's wit.
 
  • Like
Reactions: Marvin
Which is BAD
Why shouldn't comments be metadata attached to the code itself?
Are you against compiled code? Comments are going to quickly lose meaning when the code around them is transformed.
 
  • Like
Reactions: Otis Boi
Why shouldn't comments be metadata attached to the code itself?
Mate, I still print out listings of my code on physical paper, and a lot of the 'comments' for a shameful amount of my code are pen-and-paper scribbles and highlighting. Those pages (at least in theory) end up stashed away in a binder somewhere in the office that can (again, in theory) be perused at some later date. If I'm feeling extra bold I might even type up some doxygen, but you can bet your ass it will be incomplete and confusing at best.

Will things like 'operating on code ASTs' and 'attaching metadata to code directly' and 'actually fucking writing docstrings and unit tests' ever come into vogue? Perhaps, but I hope to be long retired/dead by that point.
 
  • Like
Reactions: saintJogger
Mate, I still print out listings of my code on physical paper, and a lot of the 'comments' for a shameful amount of my code are pen-and-paper scribbles and highlighting. Those pages (at least in theory) end up stashed away in a binder somewhere in the office that can (again, in theory) be perused at some later date. If I'm feeling extra bold I might even type up some doxygen, but you can bet your ass it will be incomplete and confusing at best.

Will things like 'operating on code ASTs' and 'attaching metadata to code directly' and 'actually fucking writing docstrings and unit tests' ever come into vogue? Perhaps, but I hope to be long retired/dead by that point.
Why?

Do you not know about external storage mediums or are programming on punch Cards?.
 
  • Like
Reactions: Kosher Salt
Why what? "Why do I not bother too much with redundant ephemeral documentation for my traditionally write-only code for projects that management tends to nix before they ever get traction?" Or "Why do I hope to be out of the software dev game before pointless make-work like proper, disciplined documentation and testing becomes the actual (and not just ostensible) industry standard?"

In either case, those questions kind of answer themselves, no?

Do you not know about external storage mediums
I mentioned the binder, right?

or are programming on punch Cards?.
Eww, no. Could you imagine?
 
  • Feels
Reactions: Anstiv
It's a lookup table.
It's a key-value store.
Why shouldn't the creation of code, because writing might not even be the appropriate term here, be done directly in the terms of the AST?
Because you're unable to propose anything tangible, that's why. Do some work.
Because the AST is for the compiler, not humans.
The comments, headers, how I format it, having an extra newlines here and there, the file structure, etc. aren't present in the generated AST.
This whole line of conversation is just one big "let's make programming Better™ (for a suitable definition of the word) by being both closer and further from the abstraction at the same time". It's like gender - nonbinary, abstractfluid syntaxkin, my pronouns are gcc/g++.

So AST are OK, but only in lispy-languages. Everywhere else it's eww. Because ASTs are abstraction. But at the same time not really, because they encode semantics of the computation, therefore are implementation details.

No, don't try to make sense of anything I write. I'm resorting to point-and-laugh at this point until I see anything that can be at least discussed about on its merits.
Writing an AST for code sounds like the functional-programmer equivalent of singing the praises of writing everything in assembly.
Because every single time the whole schtick is to make everything more Functional©™®, as I have stated repeatedly in this topic.
 
  • Like
Reactions: saintJogger
Yeah, I'm double posting, sue me.

It's kind of funny in a sad sort of way that they went to all that trouble developing that elaborate notation system, when an entire symphonic score can easily be represented as a single well-chosen integer with a certain prime factorization.
It took me a while to recognize what you're referring to here, but ooh may gawd that is a brilliant response to any "such-and-such notation is so complicated/suboptimal/not functional enough" weenie that I'm stealing it.
 
  • Feels
Reactions: Kosher Dill
Personally because, as much as I hate weak typing, I hate transpiling even more.
That's what I'm saying though. If they just changed browsers to be able to natively read typescript it seems like everything would be solved overnight. All you'd need to do is tell it to discard the irrelevant ts tokens and it would read it like normal js.

EDIT: I guess typesctipt has some fancier syntax than I was aware of that would make it more complex,.... but man that's just got to be streamlined sooner or later. What a miserable language.
 
Last edited:
Back