Live data from Hacker News

Aro – Zig's new C compiler

github.com

121–130 of 130 posts

Re: Aro – Zig's new C compiler

#121

Earlier quoted context omitted.

Perhaps a middle-of-the-road approach would be to use inline C like LuaJIT's FFI does? For instance: new_clib("/system/lib64/liblog.so", "log") ffi.cdef[[int __android_log_print(int priority, const char *tag, const char *msg);]] ffi.log.__android_log_print(5, "TEST_TAG", "Hello from FFI") I can't say I'm familiar with Bun, but I've used a similar syntax to the example you provided of the current Bun syntax when worki…

LuaJIT spends about 2000 lines[1] on its C parser which even includes a limited expression evaluator, though not a preprocessor. My experience suggests explicit memory management could add half again that (LuaJIT’s piggybacks on its GC), and writing one is something like a month of work even if you know exactly what you’re doing (I didn’t), but in any case it’s not a monumental task. [1] https://repo.or.cz/luajit-2.0…

[dead]

Re: Aro – Zig's new C compiler

#122
post #119

Earlier quoted context omitted.

> how did you jump from C to all programming languages, in the context of that statement? I did not say anything of the kind. Simply by taking further steps in the same direction. The submission is about Aro, and therefore comments about Aro are on-topic. By your own stated logic, Aro is a C compiler, and therefore comments about other C compilers are also on-topic. One could then go on to say that C compilers in tur…

Seems like multiple instances of either unintentionally poor logic, intentionally fake logic, or just weasel words, on your part, in your above comment that I am replying to. Here is one, i will not go into others: >>how did you jump from C to all programming languages, in the context of that statement? I did not say anything of the kind. >Simply by taking further steps in the same direction. but i did not ask you to…

> but i did not ask you to take further steps in the same direction, so that you could twist my words.

I took them to paint an example, so that my argument could be better understood. The example was clearly presented as my own; I have twisted no words of yours from what I can see, and I most certainly wasn't trying to.

> i limited myself to C and closely related topics […]

Yes, while the submission is about Aro, not C, hence the disagreement.

> […] so i will not engage further with you.

Thank you, I suppose.

Re: Aro – Zig's new C compiler

#123

Earlier quoted context omitted.

I would 100% be a D user if it had full C++ typesystem fluency.

D has a lot of compatibility with C++'s type system. But not with everything - for example, D does not have a `volatile` type. What is missing that you're interested in?

I know, and that’s a major selling point for D in my book; iirc it’s what led me to explore D in the first place. Hardly any languages have good C++ interoperability. I was following Calypso with great interest for a while, but sadly it looks like the author lost momentum, so it never got exception handling for MSVC.

What I need to work reliably from C++ are 1. instantiation of imported templates, ideally including CRTP, and 2. handling in D of exceptions thrown from C++, because if I use a C++ library that throws, I need to be able to handle the exception.

So far I’ve found languages that can import template classes and functions from C++ (usually by extending LLVM/Clang), but no languages that have good, reliable cross-platform C++ exception handling.

Re: Aro – Zig's new C compiler

#124
post #111
post #102

Earlier quoted context omitted.

The older “cross compiling Go with Zig” post might give a good start if you want to figure it out

I had a look at the post. It only shows how to tell the Go compiler how to use Zig as the C Compiler. In our case, what we need is to tell Zig to link the object files created by D. I've had a look and saw that Zig is still implementing the `ld` command, but there's already a `ld.ldd` command which might work if you know what magical options to use. I've tried to link my D object file but it can't find a whole lot of…

I have to confess to mostly just lurking Zig with interest, but not _actually_ knowing what I'm talking about. I do know their linker game has improved a _lot_ since that old Go article, so it's quite likely that Zig can do what you want. You might want to try their IRC or Discord.

Re: Aro – Zig's new C compiler

#125
post #98

Earlier quoted context omitted.

Sorry, but what does this have to do with Aro?

Sigh. See here for one way to get it, i.e. someone else's comment on the topic: https://news.ycombinator.com/item?id=41026310 If that doesn't help, start reading from the start of this subthread that starts with Walter Bright's comment about D, and pay attention throughout, otherwise don't waste your time commenting. If even that doesn't help, nothing will; sorry, I don't have the time to explain things more than tha…

> sorry, I don't have the time to explain things more than that, for a trivial matter like this.

Au contraire! You're contributed more to this sideshow than anybody: context I was fully aware of when I asked my rhetorical question.

Oh, and you probably know this in the abstract, but your patronizing tone really isn't doing your case any favors here.

Re: Aro – Zig's new C compiler

#126

Earlier quoted context omitted.

I'm all-in on Zig, I think it's the bee's knees. I needed a regex library for another project, and dashed off an acceptable one in a week flat https://github.com/mnemnion/mvzr The fun part about this is that it can compile, and match , during both comptime and runtime. Will it replace PCRE? No. But nor is it intended to.

Really want to get into it when reading these posts. Feels like rust killed my casual programming taste in last years.

Battling the compiler for casual programming is dark souls level dedication, killed my interest to until I started working more in Zig and D.

Re: Aro – Zig's new C compiler

#127
post #116
post #91

Earlier quoted context omitted.

Why would complex numbers in particular deserve to be a native type? What about quaternions, or vectors and matrices of sizes 2-4 at least? Is there any real advantage over just using a struct? Would MultiArrayList help with performance for complex numbers and vectors?

Why should complex numbers need justification to be native type? If you need to do serious computation, you need them. If you say Zig is not for number crunching which, say, Java explicitly decided then fine otherwise searching for a reason for complex number tells me that you don't do any numerical programming which is fine but asking for justification makes no sense. Why is any other thing in the language justified…

What do you mean with ” float64 is just two float32.”?

Re: Aro – Zig's new C compiler

#128
post #125

Earlier quoted context omitted.

Sigh. See here for one way to get it, i.e. someone else's comment on the topic: https://news.ycombinator.com/item?id=41026310 If that doesn't help, start reading from the start of this subthread that starts with Walter Bright's comment about D, and pay attention throughout, otherwise don't waste your time commenting. If even that doesn't help, nothing will; sorry, I don't have the time to explain things more than tha…

> sorry, I don't have the time to explain things more than that, for a trivial matter like this. Au contraire! You're contributed more to this sideshow than anybody: context I was fully aware of when I asked my rhetorical question. Oh, and you probably know this in the abstract, but your patronizing tone really isn't doing your case any favors here.

>> sorry, I don't have the time to explain things more than that, for a trivial matter like this.

>Au contraire! You're contributed more to this sideshow than anybody: context I was fully aware of when I asked my rhetorical question.

>Au contraire!

Merde! Mon Dieu! Gesundheit! (Hey, Duo, you buggy bro! that's DE, not FR) :)

I can talk fancy French too, with the help of my French mistress, aka Google Translate(ss) :) :

ton discours fantaisiste ne me dérange pas, mon garçon

original in English, by me:

your fancy talk does not faze me, boy

https://translate.google.com/?sl=en&tl=fr&text=your%20fancy%...

>sideshow

if it's a sideshow, why did you participate in it? you are a serious guy, right?

me, I am a dumbass, and just having fun.

>context I was fully aware of when I asked my rhetorical question.

I don't believe it. you are trying to CYA.

but anyway, rhetorical questioners should expect to get any kind of answers, including unexpected ones.

see ya. ciao.

wow, those last two words of mine, they kind of rhyme.

I should take up a career as a poet, since it's already a vocation, after I've spent some of my millions taking a vacation.

signed,

- funster.ai

in Westminster, bye bye.

# everything has to be AI nowadays, otherwise people don't pay attention. that's the usual convention. it's a source of dissension.

Post reply on HN