News for hackers. Stuff that matters.
Re:Ask HN: Does the design of a programming language include... by Someone on Monday June 20, 2016 @03:21PM (#11940584)
Writing an interpreter or compiler isn't necessary, but can help because it allows people to write real programs in the language, and that can tell you whether that great idea that you put in your grammar actually has value in the real world.

And you do need more than a grammar; you also have to specify semantics. For example the grammar may state that you can write "x = y" at some place in your language, but what what does it mean?

Does it copy y to x, copy x to y, make x and y refer to the same object (with choices of x, y, a new thing that has the same value as x, etc.), test whether x and y are the same object, have the same value, ascertain that x and y have the same value, ensures that they have the same value by replacing their values by their average, or is y an implicit string, and do you have to write `y or $y to reference variables in expressions? Is there any side effect? For example, does the new value of x get printed to the console by default?

(Some of the options I give are 'unconventional', but you have to specify your choice)

There are no comments on this comment yet.