プレイ日記
Phillip IAmAPerson620
Now that N# is pretty much done, I'm making my new language: H#. Its main influencers will be F# and Haskell. It will be a functional, declarative language. I'm still in the design phase though. How does this example look as far as syntax? Appealing? Repulsive? Clear? Obfuscated?
4そうだね
プレイ済み
返信[1]
親投稿
Lukas dogcutie
How do you make new programming languages?
0そうだね
プレイ済み
返信[2]
親投稿
Phillip IAmAPerson620
I write compilers that (using PRG commands) read the new language's code, parse it, and generate legal SB code. The new language can be just a syntax change (like SBSP) or be an entirely different paradigm (like N#).
0そうだね
プレイ済み
返信[3]
親投稿
Lukas dogcutie
How exactly do you do that?
0そうだね
プレイ済み
返信[4]
親投稿
Phillip IAmAPerson620
The exact process is way too complex to explain, but I basically read through each line, check for keywords or statements, and convert it into proper SB syntax. For example, "while (true)" in N# is identified as a WHILE loop, so I take the WHILE keyword and add in whatever's in parenthesis, which happens to be the 'true' keyword. Thus, the compiled output would be "WHILE true"
0そうだね
プレイ済み
返信[5]
親投稿
Phillip IAmAPerson620
As for compiling stuff like objects in N# to SB, that is much harder to do as there are no objects in SB. I had to spend days just figuring out the best way to make objects (which ended up being functions and PRGDEL/PRGINS magic) before I ever wrote a single line of code.
0そうだね
プレイ済み