Live data from Hacker News

Zig's New Relationship with LLVM

kristoff.it

221–230 of 295 posts

Re: Zig's New Relationship with LLVM

#221
post #216
post #138

Earlier quoted context omitted.

Nim and D have a similar feature, but Zig's radical design is not in including this feature but in not including others it can replace (generics and macros). Both D and Nim have generics as a separate features, and Nim has macros and D has conditional compilation as a separate features. Zig is not special in having comptime; it's special in having only comptime as the single partial-evaluation mechanism.

Are you sure that minimalism is a design principle of Zig's, and not just the current state of the project? @andrewrk's comments at https://github.com/ziglang/zig/issues/130 lead me to believe that it's still undecided. (To be clear, I don't use Zig, yet.)

Yes, I am sure it's a design principle. Which is not to say that some aspects will change. E.g. I'm in favour of some of the (more minimal) suggestions here: https://github.com/ziglang/zig/issues/1669

Re: Zig's New Relationship with LLVM

#222

Earlier quoted context omitted.

I think Zig will reserve a few interesting surprises also in the webdev world, it just needs a bit more time to get there.

I don't think zig is very well suited for / should target web dev. There a GC'd language with modern features should do best. Imagine OCaml but modern and great tooling. That would be easy for developers, more productive to write, less type errors, also more productive because of IDE support, and much faster than current crop of scripting languages. Sadly, there is a vacuum for such a language. Go is too gruntwork an…

Why not Julia?

See: https://genieframework.com https://github.com/JuliaWeb/Mux.jl https://github.com/JuliaGizmos/WebIO.jl

Re: Zig's New Relationship with LLVM

#224

I’ve often wanted to try out Zig at work but the dependency on the latest LLVM meant doing that first. Building LLVM from scratch on our platform takes more resources (including time) than I normally have available (LLDB needs like 6GB of RAM to link?) So, I welcome this news!

Even if your build system isn't set up for it, you could potentially do a cross-compiled build for just LLVM your target architecture, then just rely on those binaries?

Re: Zig's New Relationship with LLVM

#226
post #117
post #59

Earlier quoted context omitted.

That's not a stupid question. That's extremely insightful! That is exactly my model of the world, in fact. When linking incrementally, you don't want a tightly packed object file where the functions are stacked right on top of one another. You want something more akin to a key–value database, where you can swap out key–value pairs without corrupting the entire file. Whether that's an object file that "symlinks" a bun…

> You want something more akin to a key–value database, where you can swap out key–value pairs without corrupting the entire file That is kinda my point, we already have one perfectly good kv-database in the form of filesystem, so why not use that

Distribution. Convention.

We have a lot of container formats. Movie files incorporates video, audio streams, subtitles. MP3 files contains ID3, ID3v2 metadata. JPEG - Exif, PNG - metadata chunks, HTML - , , . ISO 9660 is a folder. ZIP is a folder with compression. DOCX is ZIP. These can be represented as folders and I would argue some users would like it a lot.

We use modules as files in python and ruby, yet it is a problem and docker solves it.

Zig specific - I do not think you advise to create library file for each function. As such it'd solve nothing - they'd have to patch libraries. And maybe they already have do that.

Re: Zig's New Relationship with LLVM

#227

When zig can handle line endings from this century, maybe. It's kinda crazy there's software that bothers the user to restrict CRLF. I tried zig and this was the first issue. I thought I needed to go find my AOL discs or something.

What do you mean? I've used zig on both linux and windows and never had line ending issues.

```

.\zig.exe build-exe .\hello.zig .\hello.zig:1:28: error: invalid carriage return, only '\n' line endings are supported

```

I just re-downloaded the 0.6 branch, and I get this error on latest Windows.

It's just one click in VS Code, but then I have to think about this every time I go between different files I might be working on.

It's NUTS to me that the compiler doesn't just regex them out or something, I can't justify using a technology that won't take even the smallest step for UX.

Imagine if you needed to set some character set or line-ending to bang out a python script, that'd be crazy, right? So, why should anybody bother doing it for Zig?

I want to like Zig, but I'm just not motivated to with an experience like this. I've been doing Python for a while, and I got my eyes on Nim for the next generation of languages.

Re: Zig's New Relationship with LLVM

#228
post #26

Yes, yes, yes, yes, yes. I'm going to make the kind of prediction that will set me up to be the laughingstock of HN in a few years. I think in-place binary patching will be the single most consequential development in build toolchains in the last twenty years; the most consequential development since a graduate student at the University of Illinois named Chris Lattner decided to embark on LLVM. If Zig is successful i…

Ever since I saw REPL I've wondered why. `make` knowledge is limited to file, yet even that is discarded, linker fed with every thing every time.

Re: Zig's New Relationship with LLVM

#229
post #158

I want to like Zig, but I just hate the {var | const } identifier : type syntax. I know it's an extremely superficial observation, but it just doesn't feel good to me.

many new language put type in last part of declaration. rust, go, typescript, and other

Everything old is new again!

The style dates back to Pascal. I think it's better, personally, and that might be because Pascal was my first programming language, but I don't care, I'm just happy it's back in fashion.

As a side note, I was quite sure that it dated back to Algol 60, but looked it up for this comment, and nope! Type came before variable.

Re: Zig's New Relationship with LLVM

#230

I’ve often wanted to try out Zig at work but the dependency on the latest LLVM meant doing that first. Building LLVM from scratch on our platform takes more resources (including time) than I normally have available (LLDB needs like 6GB of RAM to link?) So, I welcome this news!

I thing zig ships with the relevant prebuilt llvm if you don't mind being tied to a release.

[deleted]
Post reply on HN