[HN Gopher] How do you prototype a nice language?
___________________________________________________________________
How do you prototype a nice language?
Author : surprisetalk
Score : 10 points
Date : 2025-06-06 01:10 UTC (3 days ago)
(HTM) web link (kevinlynagh.com)
(TXT) w3m dump (kevinlynagh.com)
| norir wrote:
| Here is the most valuable exercise I can think of for language
| development: write a function that produces a formatted error
| string that renders the location of the cause of the error and
| the reason for the error. Once you have this, it will be much
| easier to write your compiler from the ground up because every
| step of the way you can validate that the compiler is only
| handling inputs that you it expect it to and rejecting everything
| else.
|
| The error reporting function is not easy to write correctly, but
| a decent one can be written in fewer than 100 lines of lua (and I
| am certain it can be done in all but the least expressive
| languages in under 200).
___________________________________________________________________
(page generated 2025-06-09 23:01 UTC)