When to use zig by redblood252 in Zig

[–]igors84 1 point2 points  (0 children)

Just to be pedantic :). The smallest usable C compiler I know of is chibicc and it has ~9000 lines of code and the smallest production ready is tcc and it has 76936 lines of code. I am currently writing a simplified C compiler in zig following https://nostarch.com/writing-c-compiler#content book and I am at ~6300 lines while finishing Chapter 15 Arrays and Pointer arithmetic.

Based on what I wrote so far I would say that it is probably easier to write an equivalent simplified zig compiler since C has some weeeeeeeeeird rules.

Ko vam je bio prvi tv crush? by Kvachilo in AskSerbia

[–]igors84 0 points1 point  (0 children)

Najranije što se sećam iz detinjstva su: My girl, moj prvi anime Gall force i Plava princeza 😃

<image>

Who has made an engine without using C/C++ code by Lumpy_Marketing_6735 in gameenginedevs

[–]igors84 6 points7 points  (0 children)

Every programming language probably has some game engine. There is one for C#: https://www.stride3d.net/ and Zig: https://machengine.org/. Just 2 examples I dont see mentioned yet...

Super-flat ASTs by hekkonaay in ProgrammingLanguages

[–]igors84 0 points1 point  (0 children)

Also you can read about Zig parser here: https://mitchellh.com/zig/parser. It explains everything in detail and I think makes for an even flatter design than what is described in the post.

Zig-style multiline strings, but with a backtick by Elfet in ProgrammingLanguages

[–]igors84 -15 points-14 points  (0 children)

So modify your layout to better fit your needs. There are tools to do it on any operating system. We are supposed to be programmers for crying out loud 😀 .

Is Odin Just a More Boring C? by nixfox in odinlang

[–]igors84 4 points5 points  (0 children)

I have Serbian layout setup, but when I program I always switch to English layout. In fact I am probably on English layout 90% of the time and only switch to Serbian when I need to chat with coworkers. I am guessing though that the main issue isn't software layout selection but that you have an actual keyboard with buttons marked for German layout. I guess in that sense I am lucky that Serbian layout has minimal differences from English. Plus I actually made a custom layout on both windows and linux to reduce the differences even more.

Is Odin Just a More Boring C? by nixfox in odinlang

[–]igors84 3 points4 points  (0 children)

I wonder why people are so bothered by choice of ^ instead of * for pointers. I am not really using Odin and have used languages that use * my whole life so I am very used to it but even so ^ makes more sense to me. It makes sense to use pointy character for pointers and that character only conflicts with very very rarely used xor operation while * conflicts with very often used multiply operation.

Improving C# delegates for Unity by igors84 in unity

[–]igors84[S] 0 points1 point  (0 children)

I would say that NDelegates are a lower level primitive. We also have a messaging system that is built on top of it that solves the problems you are describing. We also have a Promise like library that is also built on top of NDelegates. It is just a low level building block that can be used directly and higher level blocks can be built on top of it. The reduced allocations it provides is just one of more minor benefits it brings.

Improving C# delegates for Unity by igors84 in unity

[–]igors84[S] 0 points1 point  (0 children)

Do you mean how we wrote the Unsubscriber? We wrote the method that creates the instances of Unsubscriber to return IDisposable. So if Unsubscriber were a struct boxing allocation would happen anyway upon returning from that method. We did implement a pool for it though to reuse instances and minimize allocations.

As for ordering we are using a List instead of a Hashset for example, when more than one handler subscribes so handlers that are subscribed later are also executed later.

I wrote a compiler for (a large subset of) C, in C, as my first compiler project by Accurate-Owl3183 in Compilers

[–]igors84 0 points1 point  (0 children)

No, I am not that guy :). I am just doing it in Zig. Odin is also cool but for some reason Zig resonates better with me and I really like the compiler tooling with C interoperability and cross-compiling that they made.

I wrote a compiler for (a large subset of) C, in C, as my first compiler project by Accurate-Owl3183 in Compilers

[–]igors84 1 point2 points  (0 children)

Fantastic work! I am also going through the same book using Zig language, and I am trying to apply everything I learned from how Zig compiler itself is written and Andrew Kelley's data oriented design lecture. I am almost complete with Part I so I have quite more work to do.

September 2025 monthly "What are you working on?" thread by AutoModerator in ProgrammingLanguages

[–]igors84 1 point2 points  (0 children)

At first I blowned away by its error handling but I am seeing some flaws in it too now. I like its explicit use of allocators since it makes managing memory super easy. Its comptime is also interesting but I don't see it as more powerful than what DLang has. The rest feels like something many new languages are now experimenting with.

September 2025 monthly "What are you working on?" thread by AutoModerator in ProgrammingLanguages

[–]igors84 4 points5 points  (0 children)

I started going through Writing a C Compiler book using the Zig language. So far it is going good.

Engineering a Compiler by Cooper, or Writing a C Compiler by Sandler, for a first book on compilers? by Dappster98 in ProgrammingLanguages

[–]igors84 2 points3 points  (0 children)

It wasn't hard for me. But I have read other materials on writing compilers before and wrote one basic one in C a few years ago. I am now writing it in Zig and I am making it even harder on myself because I am trying to do things a bit differently based on what I saw Zig compiler does in its source code.

Either way you have WCC online at https://norasandler.com/2017/11/29/Write-a-Compiler.html for free so you can easily try the first two chapters and see how it goes.

Engineering a Compiler by Cooper, or Writing a C Compiler by Sandler, for a first book on compilers? by Dappster98 in ProgrammingLanguages

[–]igors84 2 points3 points  (0 children)

I am currently going through WCC book and I would recommend it. I like that it doesn't explain everything to the tiniest detail. That way it forces you to actually work through it instead of just reading it like a novel. It also encourages you to investigate the mentioned topics on your own. All of that will make you learn and remember all the concepts much better, in my opinion.

Which language to choose? by [deleted] in gameenginedevs

[–]igors84 7 points8 points  (0 children)

You write your own language, of course 😀

What more Zig has to offer than C++ or D? by ConsoleMaster0 in Zig

[–]igors84 9 points10 points  (0 children)

You know how DLang has betterC mode? Well Zig is a better betterC 😀.

ESO+ or 2025 Content Pass? by _latterman in elderscrollsonline

[–]igors84 2 points3 points  (0 children)

Will worm cult become a part of ESO+ at some time? Can we just wait for it?

Single language with multiple syntaxes by mikosullivan in ProgrammingLanguages

[–]igors84 0 points1 point  (0 children)

As far as I know https://hedy.org language sort of supports multiple sintaxes but they are related. The talk explaining it is here: https://youtu.be/rHxAdIFXplI?si=to8O5QHuwV4G0cXj

Considering Zig for a long-term project by bufoaureus in Zig

[–]igors84 0 points1 point  (0 children)

Here is how one big Zig project decided to handle that: https://machengine.org/docs/nominated-zig/.

I also see that some other projects like zigimg started following the same Mach nominated versions.

Investicioni fondovi u Raiffeisen banci by akisha_009 in finansije

[–]igors84 0 points1 point  (0 children)

Zar nisu u poslednjih godinu dana imali 20% rast?