Re:So you want to write your own language?
by WalterBright on Tuesday February 04, 2014 @02:20AM
(#7175947)
I deliberately tried to avoid topics that are well-covered elsewhere.
Re:So you want to write your own language?
by dllthomas on Tuesday February 04, 2014 @08:26PM
(#7181372)
Appropriate, but can you point us at some of those elsewheres?
Re:So you want to write your own language?
by WalterBright on Wednesday February 05, 2014 @12:51AM
(#7182123)
If you want to figure out how to write a lexer or parser, what better way than to read the code for one?
https://github.com/D-Programming-Language/dmd/blob/master/sr...
https://github.com/D-Programming-Language/dmd/blob/master/sr...
There's a lot of detail there, but the operation of both is straightforward.
Re:So you want to write your own language?
by dllthomas on Wednesday February 05, 2014 @10:11AM
(#7184117)
I'd thought this subthread was discussing semantics.
Re:So you want to write your own language?
by johnbender on Wednesday February 05, 2014 @10:45PM
(#7188612)
For anyone who comes across this thread and is genuinely interested in educating themselves about how programming languages can be constructed in a principled way (what I would call sane) you can consult Pierce's Types and Programming Languages.
With some work anyone can learn the material. It's not as simple as reading a blog post unfortunately, but you'll have a much deeper understanding of what it means to build a programming language.
Re:So you want to write your own language?
by ericbb on Friday February 07, 2014 @09:21PM
(#7200035)
I'm in the midst of reading Types and Programming Languages right now.
I'm also reading the more recent Practical Foundations for Programming Languages by Robert Harper. It's written for a similar audience.
I would recommend both.
Re:So you want to write your own language?
by he_the_great on Tuesday February 04, 2014 @11:08PM
(#7181836)
If someone wants to build a language and "A programming language is the semantics" doesn't it really make sense to tell them what the semantics should look like?
Re:So you want to write your own language?
by johnbender on Wednesday February 05, 2014 @10:41PM
(#7188601)
Sorry I thought I was being clear when I mentioned operational semantics but in retrospect that may have been totally unclear. I recommend Pierce's Types and Programming Languages. It has everything you need to learn about operational semantics and types systems.
A programming language is the semantics and without a strong notion of those semantics and the interactions you end up with confusion and difficulty. For an example one need look no further than Ruby's "implementation as specification" crazyness.
I won't go as far as to say that all language creators should adopt operational semantics when building a language, but if you're serious about it then you should at least investigate the process.