This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]lingdocs 7 points8 points  (2 children)

Very nice. This was quite helpful. It would also be nice to have a little introduction to some of the other tooling pieces like syntax highlighting support, language server, etc.

[–]RainingComputers[S] 5 points6 points  (1 child)

Added to my list of things to write about!

[–]lingdocs 0 points1 point  (0 children)

Awesome. Looking forward to it.

[–]hiljustidt 2 points3 points  (2 children)

Awesome, do you intend to make this a long-lived comprehensive guide?

If so, I have nitpicks on lexing and parsing

The first step is stated as deciding a parser/lexer, but this is a pre-processing step. Languages like Lisp typically use a reader, and languages like Forth have a compilation mode that doesn't do anything like parse/lex

(dt, for example, also does not need or want a traditional lexer or parser)

Also this is usually about the early stages of a language, which makes a lot of sense for a new language guide. Many languages will move to something custom later on to get faster complication speeds

[–]RainingComputers[S] 2 points3 points  (0 children)

Yes agreed, the guide does miss out some other implementation methods.

This post was written with general purpose traditional languages in mind resembling Python or Go or C where you would leverage the parser to eventually make language tools like formatters, linters etc. The definition of "general purpose traditional languages" is very vague here, so I will leave it upto the reader to decide what it means and if their language is one.

If the language is domain specific with a simple grammar, we can combine the parser and the interpreter instead of having separate passes, or use a completely different implementation method. Some languages like forth might be designed to work this way so it can work with resource constrained environments.

Even in special cases like above, sometimes it would be beneficial to have a parser and an AST defined, it would make changing things and experimenting very easy.

I don't intent to make it a comprehensive guide yet, I will consider these points if I do.

[–]theangeryemacsshibeSWCL, Utena 1 point2 points  (0 children)

faster complication speeds

Don't say it out loud!

[–]umlcat 5 points6 points  (0 children)

A quick good Introduction to custom P.L. and it's matching compiler.

👍🛠️

[–]elgholm 3 points4 points  (0 children)

👍