Post 350837 by cpsdqs@icosahedron.website
 (DIR) More posts by cpsdqs@icosahedron.website
 (DIR) Post #342090 by freundTech@mastodon.xyz
       2018-10-02T21:55:22Z
       
       0 likes, 0 repeats
       
       Writing a compiler is hard!
       
 (DIR) Post #342091 by cpsdqs@icosahedron.website
       2018-10-03T06:22:17Z
       
       0 likes, 0 repeats
       
       @freundTech but, why are you writing a compiler
       
 (DIR) Post #342092 by MightyPork@dev.glitch.social
       2018-10-03T06:23:52Z
       
       0 likes, 0 repeats
       
       @cpsdqs @freundTech why not! It's fun, kinda, uhhh a little
       
 (DIR) Post #342183 by cpsdqs@icosahedron.website
       2018-10-03T06:37:05Z
       
       0 likes, 0 repeats
       
       @MightyPork @freundTech I dunno I always get the feeling writing a compiler involves handling lots and lots of special cases
       
 (DIR) Post #350328 by freundTech@mastodon.xyz
       2018-10-03T08:46:07Z
       
       0 likes, 0 repeats
       
       @cpsdqs Because I'm trying to create a language, that compiles to .mcfunction, a format used by minecraft datapacks.It's basically just a list of minecraft commands in a file, that can be run with /function <NAME>.I'm currently stuck on code generation for arithmetic expressions, as all of the resources I can find for that use a stack machine, however I can't think of a way to implement a stack with scoreboards, so I have to use an accumulator/register machine instead.
       
 (DIR) Post #350329 by freundTech@mastodon.xyz
       2018-10-03T19:32:00Z
       
       0 likes, 0 repeats
       
       @cpsdqs successfully compiled "test2 = test + 1" to scoreboard commands!
       
 (DIR) Post #350330 by cpsdqs@icosahedron.website
       2018-10-03T19:32:54Z
       
       0 likes, 0 repeats
       
       @freundTech wowthat’s more than my ruby vm could do after a day of writing stuff
       
 (DIR) Post #350331 by MightyPork@dev.glitch.social
       2018-10-03T19:34:15Z
       
       0 likes, 0 repeats
       
       @cpsdqs wow a spooky cat avatar
       
 (DIR) Post #350412 by cpsdqs@icosahedron.website
       2018-10-03T19:39:20Z
       
       0 likes, 0 repeats
       
       @MightyPork yes, with cute little fangs
       
 (DIR) Post #350830 by freundTech@mastodon.xyz
       2018-10-03T19:42:52Z
       
       0 likes, 0 repeats
       
       @cpsdqs Well to be fair: I've been writing on it for 2 days now.Also I should clean up my code. It's already starting to get messy...
       
 (DIR) Post #350831 by cpsdqs@icosahedron.website
       2018-10-03T19:51:08Z
       
       0 likes, 0 repeats
       
       @freundTech hmwhich language :P
       
 (DIR) Post #350832 by freundTech@mastodon.xyz
       2018-10-03T19:52:13Z
       
       0 likes, 0 repeats
       
       @cpsdqs python... Maybe not the fastest language, but fast to write. Also lark-parser is a great python library for parsing context-free grammars.
       
 (DIR) Post #350833 by cpsdqs@icosahedron.website
       2018-10-03T19:55:57Z
       
       0 likes, 0 repeats
       
       @freundTech I have no idea what that is but apparently I will this Friday
       
 (DIR) Post #350834 by freundTech@mastodon.xyz
       2018-10-03T20:06:40Z
       
       0 likes, 0 repeats
       
       @cpsdqs There are different types of languages, which require different automata to parse.The most simple are regular languages, which can be described using regular expressions and parsed using a finite state automaton.Then there are context-free languages, describes by context-free grammars. Most programming languages are context-free languages. They can't be described by regular expressions.Then there context-sensitive and recursively enumerable languages.
       
 (DIR) Post #350835 by cpsdqs@icosahedron.website
       2018-10-03T20:09:35Z
       
       0 likes, 0 repeats
       
       @freundTech sometimes I wonder how they spend an hour explaining something that fits into three lines
       
 (DIR) Post #350836 by freundTech@mastodon.xyz
       2018-10-03T20:18:44Z
       
       0 likes, 0 repeats
       
       @cpsdqs There's a lot more to explain about that. For example how those grammars work and how to do the actual parsing.For example regular expressions are defined as such:∅ (empty set) is a regular expression𝜀 (empty word) is a regular expressionAll a ∈ Σ (set of terminals/letters) are regular expressionsIf α and β are regexs then αβ, (α|β) and (α)* are also regexs.Every regex can be describes using only those rules. Modern languages just add stuff to make writing them easier.
       
 (DIR) Post #350837 by cpsdqs@icosahedron.website
       2018-10-03T20:24:16Z
       
       0 likes, 0 repeats
       
       @freundTech huh.
       
 (DIR) Post #350838 by MightyPork@dev.glitch.social
       2018-10-03T20:25:24Z
       
       0 likes, 0 repeats
       
       @cpsdqs @freundTech then there's nonsense languages i invented for my many dumb projects and they're probably something in between
       
 (DIR) Post #350874 by cpsdqs@icosahedron.website
       2018-10-03T20:28:27Z
       
       0 likes, 0 repeats
       
       @MightyPork @freundTech this all feels like, discovering that there’s an actual correct way of doing stuff you just botched together for years
       
 (DIR) Post #351424 by AVBodge@mastodon.xyz
       2018-10-03T21:10:36Z
       
       0 likes, 0 repeats
       
       @cpsdqs @freundTech starting uni? Or why this Friday?
       
 (DIR) Post #351425 by cpsdqs@icosahedron.website
       2018-10-03T21:11:54Z
       
       0 likes, 0 repeats
       
       @AVBodge @freundTech twas heavily recommended
       
 (DIR) Post #351426 by MightyPork@dev.glitch.social
       2018-10-03T21:13:53Z
       
       0 likes, 0 repeats
       
       @cpsdqs @AVBodge @freundTech regulare sprachen lol