Live data from Hacker News

The Titania Programming Language

github.com

21–30 of 68 posts

Re: The Titania Programming Language

#21
post #10

Having done a fair degree of programming in Wirthwhile languages, I think the only main design decision that I think was a mistake was the variables at the top. I'm not sure of the value of seeing all of the variables used listed in one place, it has certainly led to me encountering a identifier scrolling up to determine the type then scrolling back down. When the variable is only used on a few consecutive lines it's…

When I write the backend (this repo isn't even 24 hours old yet), you'll find out why variable declarations are at the top of a procedure. (Hint: it has something to do with the stack).

Re: The Titania Programming Language

#23
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/ and 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/ and 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 page 12).

Re: The Titania Programming Language

#24

This repo isn't even 24 hours old yet and it's on HackerNews... Just wow....

Is the language/project somehow related to Odin or its ecosystem, or is it completely independent?

If the latter, I wonder how you can manage another programming language alongside Odin — anyway, thank you and great respect for both!

Re: The Titania Programming Language

#25
post #10

Having done a fair degree of programming in Wirthwhile languages, I think the only main design decision that I think was a mistake was the variables at the top. I'm not sure of the value of seeing all of the variables used listed in one place, it has certainly led to me encountering a identifier scrolling up to determine the type then scrolling back down. When the variable is only used on a few consecutive lines it's…

This design decision makes compiler implementation easier and especially enables single-pass compilation. Later Oberon versions at least supported more than one declaration section in arbitrary order, but still no in-place declarations.

Re: The Titania Programming Language

#26

Very nice project, I'm a big fan of implementing Wirthian languages to learn compilers. Also, in true Wirth style, the documentation mainly consists of the language grammar :)

The project is not even 24 hours old...

And I might plan on making this a recorded series of explaining how to make compilers from scratch with this language as a reference.

Re: The Titania Programming Language

#27

Very nice project, I'm a big fan of implementing Wirthian languages to learn compilers. Also, in true Wirth style, the documentation mainly consists of the language grammar :)

> the documentation mainly consists of the language grammar :)

It's a bit more than just the grammar, but I agree it's generally underspecified.

Re: The Titania Programming Language

#28
post #10

Having done a fair degree of programming in Wirthwhile languages, I think the only main design decision that I think was a mistake was the variables at the top. I'm not sure of the value of seeing all of the variables used listed in one place, it has certainly led to me encountering a identifier scrolling up to determine the type then scrolling back down. When the variable is only used on a few consecutive lines it's…

Wirth was obsessed with the idea of creating the absolutely minimal useful language, and many of his languages' warts come from that.

Variables are at the top because:

- you immediately see them (so, perhaps, easier to reason about a function? I dunno)

- the compiler is significantly simplified (all of Wirths' languages compile superfast and, if I'm not mistaken, all are single-pass compilers)

However, I feel that Wirth was overly dogmatic on his approaches. And "variables must always be at the top" is one of those.

Re: The Titania Programming Language

#29
post #17

> teach compiler development with Not trying to be confrontational, genuinely curious.. but why is this an area where you'd want a DSL? My initial reaction is : When I'm learning a topic, the last thing I want to be worrying about is learning the ergonomics of a new language I'm guessing there's a good rational I'm missing it'd be nice to see some piece of compiler related code in this language that'd be ugly in a ge…

I have teached Pascal 25 years ago. The idea was to teach the basic principles of programming (loops, variables, arrays, linked lists, sorting, etc.) without worrying about the technical details (C was too tricky, python was not there). Plus Pascal is quite simple and has very few pitfalls.

Once students where proficient in Pascal, we could introduce compiler classes and, when sufficiently advanced, show what the Pascal BNF grammar looked like. So students had a complete picture of a language. Pascal's BNF grammar is very simple.

Also, Pascal enforces strong program structures (BEGIN, END, PROCEDURE, FUNCTION, etc). which helps to frame practical work.

Re: The Titania Programming Language

#30
post #23

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/ and https://github.com/rochus-keller/oberon/ ). Eventually I had to give up backward compatibility to ge…

Please 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).

Post reply on HN