4 ms·
Remarkable that Bill is interested in a version of Oberon-07. It's even more minimalistic than the previous Oberon versions. I spent a lot of time with the orig
by Rochus 1y ago
Remarkable that Bill is interested in a version of Oberon-07. It's even more minimalistic than the previous Oberon versions. I spent a lot of time with the original Oberon language versions and experimented with extensions to make the language more useful for system programming (e.g. https://oberon-lang.github.io/ https://oberon-lang.github.io/ and https://github.com/rochus-keller/oberon/ https://github.com/rochus-keller/oberon/). Eventually I had to give up backward compatibility to get to a language which I really consider suitable for system programming (and still minimal in the spirit of Oberon, see https://github.com/micron-language/specification/ https://github.com/micron-language/specification/ and https://github.com/rochus-keller/micron/ https://github.com/rochus-keller/micron/); it's still evolving though.
If I get it right, Bill's language is considered for teaching purpose, which is also a goal of Wirth's languages, and for which these languages are well suited (especially for compiler courses). Also note that the name "Oberon" was not inspired by Shakespeare, but by the Voyager space probe's flyby and photography of Uranus's moons during the mid-1980s when the language was being developed (see https://people.inf.ethz.ch/wirth/ProjectOberon/PO.System.pdf https://people.inf.ethz.ch/wirth/ProjectOberon/PO.System.pdf page 12).
- gingerBill 1y agoPlease note the project isn't even 24 hours old yet. But I am using Oberon-07 as base, and I might deviate from it quite soon too. But I won't be going in the direction of things like Oberon+ (which adds generic and OOP programming) or Micron which adds the entire type system necessary to interact with foreign code. I just wanted something to explain to people how to do tokenizing, parsing, semantic checking (not just basic types), and machine code generation, and this seemed like the best language to choose. n.b. I know the name does comes from from the Voyager space probe, but I wanted to keep it directly related somehow, and Titania was the best fit. It's also a moon of Uranus, and there is a story relation to Oberon (Fairy King).
- Rochus 1y agoSupporting lowercase keywords and making (at least some) semicolons optional already makes Oberon much more attractive ;-)
- gingerBill 1y agoAnd removing unnecessary keywords and modernizing it too. `[N]T` for arrays and `^T` for pointers, rather than `array N of T` and `pointer of T`. And supporting C++ style code `/*/` and `//`. And as I develop this, I'll tweak it more so that people can actually understand without having to know the full histories of Pascals or Oberons or whatever.
- Rochus 1y agoI have also implemented these and other simplifications in my languages, and I don't think it makes them any less readable. Looking forward to seeing your final design.
- cxr 1y agoTrying to eliminate semicolons by doing JS-style ASI is gross and complicates things unnecessarily. You can trivially change the parser/grammar so that the semicolons in import, var, procedure, etc. declarations just aren't required, and likewise with statements that end in "end". They'll still be necessary for statements comprising things like assignments and procedure calls, but for a teaching language who cares. (Your grammar is missing a definition for proc_call, by the way.)
- gingerBill 1y agoI only added that a few minutes ago, and it's a question of whether I should or not. This project is so goddamn new that I have not even decided anything. I was not expecting anyone posting this to HackerNews in the slightest. Also this isn't JS-style ASI technically speaking, and it won't have any of the problems either. The syntax for this language is different enough that it won't be a problem. Procedures don't even return things.
- cxr 1y agoI'm referring to the semicolon insertion described in the README as, "When a newline is seen after the following token kind, a semicolon is inserted". > Procedures don't even return things Oberon allows return values from functions (which are still declared with the PROCEDURE keyword). It looks like the same is true in Titania: proc_body = decl_sequence ["begin" stmt_sequence] ["return" expr] "end". <https://github.com/gingerBill/titania/blob/085b7b5bcf7f0607691e575cd473dd5800b9e6be/src/parser.odin#L222 https://github.com/gingerBill/titania/blob/085b7b5bcf7f06076...> I'm curious what you're going to do with the code generator. Parsers are easy and can be completed in a day or two. Even with a reference implementation, however, it's the backend that's a slog.
- emigre 1y agoReally nice project, well done. I would say it's probably not necessary to explain what the connection between Titania and Oberon is in the README. It's probably evident to most people?
- cozzyd 1y agoAlas, most people have memorized at most seven Shakespearean sonnets.
- emigre 1y agoDefinitely wise not to choose "uranus" as the name. ;)
- eterps 1y ago> But I am using Oberon-07 as base, and I might deviate from it quite soon too. I am curious about your thoughts on var parameters (i.e. mutable references), as in: proc increment(var x: int) begin x := x + 1 end var i: int begin i := 10 increment(i) // i is now 11 end
- gnatmud8 1y agoi also wonder about this concept; is there a programming language that has this behavior?