5 ms·
show a code sample before your whole manifesto
by blt 8y ago
show a code sample before your whole manifesto
- winter_blue 8y agoI actually prefer to read the philosophy of a language, before diving deeper into the language itself. It gives you an idea of the author's motivations for creating the language. I feel like a code sample would make it too easy to judge its syntax, and not tell you enough/much about its semantics.
- agumonkey 8y agoThe 'sample' thing is a result of the era, where people wanted to streamline language diffusion. I think it became a bit too much of a reflex for people to expect the same first piece of information about a language. I too need more than a sample and prefer a larger explanation.
- zwkrt 8y agoEspecially considering the syntax of this language is kind of strange. Seeing a hello world without context would put me off I think.
- s-shellfish 8y agoI don't think it aligns with the philosophy of the language either, to essential chunk ideas into large discrete blocks of particular categorical intents. It seems like the intent is to distribute programming concepts on a finer granularity than most languages tend to retain flexibility for, as structure builds.
- PeCaN 8y agoFrankly, to me the specifics of the syntax are not nearly as important as what the language does. This: > Abstraction by heap allocation is a dead end. It works moderately well on the current generation of computers where CPU is still the dominant driver of computation. > It cannot work for devices like GPUs and the rest coming down the line. tells me way more about the language (and gets me much more interested) than a "hello world" would. I think syntax is by far the easiest part of a new language to learn, so it's ultimately not that important. EDIT: Regardless, it turns out it actually gives code samples like a page or two down.
- garmaine 8y agoI don't trust that it actually achieves those goals without seeing code. Show an illustrative example of what you are trying to do and how it is accomplished, then wax philosophic.
- coldtea 8y agoWhat he's trying to do is not conveyed in example code. That said, he gives plenty of examples.
- ghayes 8y agoI just want to mention that code samples are about more than syntax. E.g. a code sample of Elixir might spawn concurrent processes, or a code sample of Idris might show type-safe vector concatenation.
- DEADBEEFC0FFEE 8y agoI am not a developer beyond hobby scripts and such, and I find these threads and comments like this extremely interesting. Other people's domains are frequently fascinating.
- plaguuuuuu 8y agothere are heaps of samples on that page.
- garmaine 8y agoWhich you have to scroll past pages of manifesto to find, and all the examples seem to be basic illustrations of syntax. Where are the examples showing how this approach to a language actually results in superior code bases or more efficient programs or whatever?
- blt 8y agoYes I agree that the language semantics and the philosophical motivation are more important. But there is a reason academic papers have abstracts. The core ideas should be summarized crisply at the beginning of a technical document. A few sentences and a code sample are the equivalent of an abstract for programming languages.
- abecedarius 8y agoA related-work section would really help, too.
- abstractcontrol 8y agoI do not think there is a language with capabilities similar to Spiral. If it existed it would have saved me a lot of time. The closest you could get would would be [Scala LMS](https://scala-lms.github.io/ https://scala-lms.github.io/) and the work done on staging such as in [context of Ocaml](http://ocamllabs.io/iocamljs/staging2018.html http://ocamllabs.io/iocamljs/staging2018.html). Personally I think macro-style staging in statically typed languages is an atrocity and want nothing to do with it. I kind of like the type driven version as is done in LMS, but compared to Spiral the LMS is less expressive. A lot of work is being done on macros/partial evaluation/staging in Scala and I assume it will continue to be done as the authors are aware of the need for this in a language - without it a functional language would be dog slow, but my impression is that they are having significant difficulties making it fit with Scala's much more complex type system. One consequence of that is that they seemingly rewrite their macro system every few years. This time they will surely get it right despite being at it for decade(s). The reason why what Spiral has works so well is because its type system is so simple, so staging can be completely intervowen with how it does type inference. My view based on seeing the last 50 years of language design is that staging is really difficult to bolt onto an already established design. It tends to degenerate into having two languages - the core language and a scripting language on top of it. C++'s template system is the worst example of this. Another example which actually embraces this dichotomy would be [Terra](http://terralang.org/ http://terralang.org/) which could be described as bolting Lua on top of C. I rather dislike this sort of design. A language needs to be designed around staging from the ground up and it needs to be accepted that in the absence of magic, the programmer will have to mold his style to fit with the new paradigm. If a language is to have staging it should be everywhere and at all times much like regular type inference is in F# and other ML styled languages.
- DennisP 8y agoIt does even better, it has a table of contents right at the top, so you can skip directly to whatever you want. "Intro" and "Design Philosophy" sound like manifestos, so pass over those and click on "Tutorials."