[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: odin.png (83 KB, 460x460)
83 KB
83 KB PNG
https://imgur.com/a/5a9kOG4
>>
>>101572987
>Simplicity and readability
Buddy, I just lost interest at line 28. That isn't simple or legible.
>Minimal: there ought to be one way to write something
Lmao that doesn't look like it.
>Striving for orthogonality
Good luck
>Programs are about transforming data into other forms of data
Isn'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 languages
Why use horses when you have engines and wheels?
>The entire language specification should be possible to be memorized by a mere mortal
I'm sold, sarcastically speaking.
>>
>>101574453
Having 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.
>>
>>101574550
Ok, convert that code into other languages and we'll compare. I'll wait.
>>
>>101572987
I like Odin. Odin is a cool god and I flashed quite a couple of Samsung phones with it.
>>
>>101572987
rewrite it in k&r c
>>
>>101574588
Shouldn't you write the interpreter in a language that you like?
>>
>>101574715
The 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)
>>
>>101572987
does 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
>>
>>101574804
Idc about proving anything. I just like Odin. It's a very nice low-friction language.
>>
>>101574839
I don't think it leaks anything? I might check later with a different allocator.
>>
>>101574993
are you checking the error condition?
>>
>>101575001
Which one?
>>
>>101575109
nigga 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 used

anyway, gonna keep using it
>>
>>101575136
Oh 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?
>>
>>101575302
True, Zig is so annoying and gross to use.
>>
>>101572987
>imgur
The absolute state of /g/.
>>
>>101575576
usually 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.
>>
>>101575651
I tried to upload the image directly on 4chan but it was too much for it
>>
>>101575691
and you expect to be taken seriously?
>>
>>101572987
why link the code via imgur? Why not just post the image directly?
>>
>>101572987
pretty 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?
>>
>>101572987
Just use Golang
>>
>>101578160
why 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
>>101575691
Resolution was too big
>>
>>101577948
Not sure what you mean ngl.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.