https://imgur.com/a/5a9kOG4
>>101572987>Simplicity and readabilityBuddy, I just lost interest at line 28. That isn't simple or legible.>Minimal: there ought to be one way to write somethingLmao that doesn't look like it.>Striving for orthogonalityGood luck>Programs are about transforming data into other forms of dataIsn't that the definition of "programs"? What does this have to do with the language itself? And how is that any different?>There is embedded knowledge and wisdom in older programming languagesWhy use horses when you have engines and wheels?>The entire language specification should be possible to be memorized by a mere mortalI'm sold, sarcastically speaking.
>>101574453Having a tokenizer and an interpreter in ~100 lines of code is pretty simple and concise. Long code isn't generally legible "lgtm," but you wouldn't read a brainfuck interpreter in any programming language either way.
>>101574550Ok, convert that code into other languages and we'll compare. I'll wait.
>>101572987I like Odin. Odin is a cool god and I flashed quite a couple of Samsung phones with it.
>>101572987rewrite it in k&r c
>>101574588Shouldn't you write the interpreter in a language that you like?
>>101574715The point to be proven is to contradict Odin's claim by writing an interpreter in another language and see which language is the most concise. It doesn't matter which one but preferably the ones that are mostly used today (i.e C#, JavaScript, Python)
>>101572987does this have a trivial leak or is there some magic that prevents it?
>>101574453>Buddy, I just lost interest at line 28. That isn't simple or legible.My dude, it's 2 switch cases. What do you mean it's not legible
>>101574804Idc about proving anything. I just like Odin. It's a very nice low-friction language.
>>101574839I don't think it leaks anything? I might check later with a different allocator.
>>101574993are you checking the error condition?
>>101575001Which one?
>>101575109nigga if your tokenize function returns an error it doesn't free instructions.
I really like Odin, it's a shame Zig got all the attention even though it's objectively the worse language. I guess it's because of the "it's a C compiler" stuff, but I have to say Odin has the easiest FFI system I've ever usedanyway, gonna keep using it
>>101575136Oh yeah, true. I had a defer delete instructions, but I felt like this was wrong as I was returning the instructions to the caller. It wasn't clear to me what was going on. Did the caller get another copy? Was it a soft delete and the memory hasn't been corrupted yet?
>>101575302True, Zig is so annoying and gross to use.
>>101572987>imgurThe absolute state of /g/.
>>101575576usually this is handled by having a goto error; statement for error cases, and cleanup handling for the error label. Dunno what the equivalent pattern in odin is.
>>101575651I tried to upload the image directly on 4chan but it was too much for it
>>101575691and you expect to be taken seriously?
>>101572987why link the code via imgur? Why not just post the image directly?
>>101572987pretty neat much better than the c version I wrote a time ago. I am sure you could have done better with the tokenize thing and just rolled a dict no?
>>101572987Just use Golang
>>101578160why be slow when you can be fast?if I'm going to let the language manage my memory I'm using C#, not Go lmao
>>101577930>>101575691Resolution was too big
>>101577948Not sure what you mean ngl.