5 ms·
> Luna is the world’s first programming language featuring two equivalent syntax representations, visual and textual. Is this true? This is not my strong domai
by jgtrosh 7y ago
> Luna is the world’s first programming language featuring two equivalent syntax representations, visual and textual.
Is this true? This is not my strong domain but I'm sure there are such programming languages.
- SiempreViernes 7y agoI guess this hinges on exactly what meaning is hidden in the word "equivalent", I could imagine that a very tight coupling of text and visual forms would be novel.
- hjek 7y agoYes, exactly. Depending on the definition of "equivalent", Puredata[0] may or may not qualify as well. [0]: https://puredata.info/ https://puredata.info/
- worldsayshi 7y agoDoes Pd have a textual representation intended to be human readable?
- jazzyjackson 7y agoEverything is saved as plaintext, but it is not meant to be readable really. here's an excerpt from some of my code. #N canvas 340 73 884 380 10; #N canvas 0 0 1362 686 sendchord 0; #X msg 241 135 60; #X msg 240 167 64; #X msg 241 200 67; #X obj 191 173 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 283 450 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1;
- hjek 7y agoHello world in Pd: #N canvas 0 0 100 100 100 10; #X obj 0 40 print; #X msg 0 20 hello world; #X obj 0 0 loadbang; #X connect 1 0 0 0; #X connect 2 0 1 0; Compared to Hello World in Java, it's actually not that unreadable IMO.
- viraptor 7y agoYou've got 20 magic integers with no explanation in the source. Java version does not contain that.
- hjek 7y agoYup. Magic integers are bad for readability. So are "magic phrases", like public static void. I think the readability of Pd is horrible, but the question was whether it was human readable at all.
- viraptor 7y agoI don't think they're in the similar category at all. Keywords are part of the syntax - if you know what they are in one place, you know what they are in another. (even if they have multiple meanings) Magic numbers are use-specific and you need extra context to understand them. They're part of the code, not the language itself - although the language can help the situation by enforcing naming in some cases.
- hjek 7y agoWell, I think many programming keywords have a form of meaning that you need extra context to understand. How would I intuitively could guess what 'public static void' was, withing having any idea about OO or Java? I mean, 'void' is perhaps OK, but don't tell me you could understand 'swing' with no context, just by reading the word?
- hjek 7y agoI guess only Miller Puckette can provide an answer about the intention. It also depends what we consider human readable: Does it mean that some or many or most humans can read it? It's a custom plain text format[0] that is perhaps a little bit less readable that HTML. I have been reading and writing Pd patches in textual representation (and I'm human). Not sure if that's an answer to the question. I've seen a Scheme editor that does visual representation, slightly similar to Scratch, but can't remember the name of it. AsciiDots is both visual and textual (although it's not two different syntaxes). [0]: https://puredata.info/docs/developer/PdFileFormat https://puredata.info/docs/developer/PdFileFormat [1]: https://github.com/aaronjanse/asciidots https://github.com/aaronjanse/asciidots
- dkersten 7y agoYeah. Its purely hype on luna's part.
- lioeters 7y agoAll programming languages can be reduced to an abstract syntax tree as the canonical ("equivalent") representation of a program, with visual and textual views. I'm sure there are prior examples - HyperCard, Max/MSP, .. Edit: Gotta say, I love x3 the design/aesthetic/presentation of the Luna language.
- TheAsprngHacker 7y agoThe Scratch programming language has an unofficial text syntax called Tosh: https://tosh.blob.codes/ https://tosh.blob.codes/ The in-development GP language can alternate between blocks and text: https://en.scratch-wiki.info/wiki/GP_(programming_language) https://en.scratch-wiki.info/wiki/GP_(programming_language)
- DonaldFisk 7y agoScratch is a textual language with a visual editor and representation. Having two easily readable, equivalent, representations for dataflow programs is a lot more of a challenge.
- johnday 7y agoThis is not true. GameMaker does this at the very least. You can swap between the visual and direct GML language whenever you want. I seem to remember a visual javascript thing which had the same feature.
- teamonkey 7y agoUnreal Engine's Blueprint language has an equivalent plaintext form. You can copy nodes from the visual editor, paste them to a text editor and vice-versa. I think it's more a form of serialisation, but code is data is code... For example: https://blueprintue.com/blueprint/h6gkslt6/ https://blueprintue.com/blueprint/h6gkslt6/