Other Ziglang programming language

mrbeastie0x19

Member

Reaction score: 58
Messages: 96

Not sure I'd agree with that, there are only really three big c compilers and two of them have very quite clear backers. D, Nim, Rust, Go, and now this, and many more. I've been around a lot, but everyone goes back to C or Cpp, because eventually they come across a problem and they discover the reason those two languages are used so much.
 

kpedersen

Son of Beastie

Reaction score: 2,095
Messages: 2,953

Not sure I'd agree with that, there are only really three big c compilers and two of them have very quite clear backers.
Very clear backers but only for individual compilers (not the standard) and there are *many* of them to pick up the slack when one becomes corrupt.

Some examples. Though there are more C compilers than known stars in the universe (assuming an infinite universe with infinite intelligent species to develop C compilers). Some of the core ones.
  • SunCC - Oracle
  • GHC - Green Hills
  • xlC - IBM
  • IntelCC - Intel (now Clang based)
  • Borland / Embarcadero CC (now Clang based)
  • GCC - GNU
  • Clang - Many companies
  • cl - Microsoft
  • wcl - OpenWatcom
  • Kiel 8051CC - Arm
Possibly the *only* companies that the whole platform is very tied to is Edison Design Group and Dinkumware. These are much lesser known but more crucial than people might imagine.
 

mrbeastie0x19

Member

Reaction score: 58
Messages: 96

Very clear backers but only for individual compilers (not the standard) and there are *many* of them to pick up the slack when one becomes corrupt.

Some examples. Though there are more C compilers than known stars in the universe (assuming an infinite universe with infinite intelligent species to develop C compilers). Some of the core ones.
  • SunCC - Oracle
  • GHC - Green Hills
  • xlC - IBM
  • IntelCC - Intel (now Clang based)
  • Borland / Embarcadero CC (now Clang based)
  • GCC - GNU
  • Clang - Apple (though LLVM is not born from Apple)
  • Kiel 8051CC - Arm
Possibly the *only* companies that the whole platform is very tied to is Edison Design Group and Dinkumware. These are much lesser known but more crucial than people might imagine.
Most of those compilers have not been updated for a long time and it will be a long time before they get current standards support (Not even the big 3 have full cpp 20 compliance yet) But it really depends on what you are after, again here is a strength of C, there are so many legacy options. In terms of active development GCC, Clang, and MSVC are the big three, and in a sense they're kind of tied to a particular platform.
 

kpedersen

Son of Beastie

Reaction score: 2,095
Messages: 2,953

Most of those compilers have not been updated for a long time and it will be a long time before they get current standards support (Not even the big 3 have full cpp 20 compliance yet) But it really depends on what you are after, again here is a strength of C, there are so many legacy options.
Quite true but the fact that we use the main three you mentioned is ultimately a *choice*. If they disappeared tomorrow, we wouldn't particularly be in trouble. There are plenty alternatives left to dust off and get back to work :).

Contrast this to if the one Swift or Rust compiler disappeared (or more likely removed support for your required platform). The whole ecosystem would be broken.

This is semi closely related to .NET, Mono, dotnetcore/roslyn. Microsoft has gone out of their way to make it look like there are many C-Sharp.NET compilers. However they are all owned, developed and governed by Microsoft. So *when* they lose interest, it will be funny.
 

Jose

Daemon

Reaction score: 1,000
Messages: 1,203

Likely the Garbage Collector was an instant turn off. This causes too many problems with C API's because the GC can't perfectly scan raw heap or stack memory without more contextual information (is that chunk an integer, float, pointer or an array of chars?).

I think there are only a few D compilers around too. Not exactly the languages fault but it is unlikely developers want to tie themselves down to single vendors these days. That is extremely old fashioned behavior.
I used to follow D, and I remember reading a news item where the author said something like "So-and-so has convinced me that D needs variadic templates..." I knew then that the end was near. So-and-so was probably a member of the C++committee. The garbage collector followed soon after.

But your point about the compiler is well-taken. I think that's how the author got paid, so it's not like I blame him, but yeah, history passed him by.
 

Jose

Daemon

Reaction score: 1,000
Messages: 1,203

Very clear backers but only for individual compilers (not the standard) and there are *many* of them to pick up the slack when one becomes corrupt.
I was surprised to see that Vlang supports tcc:
You need git, and a C compiler like tcc, gcc or clang, and make:
I thought that project was dead:
Note: I am no longer working on TCC. Check the mailing list to get up to date information.

There was talk of adopting it as the C compiler in base for Openbsd some years ago.
Edit: This is an interesting page:
 

kpedersen

Son of Beastie

Reaction score: 2,095
Messages: 2,953

I thought that project was dead:
I think that Bellard stopped working on TCC but there is some community around it doing some maintenance. On Windows, I actually still tend to use it. The others are just a mess of online downloaders or POSIX emulation layers whereas TCC holds some simple elegance. It also provides a much more capable tool to provide .dll exports which is very convenient.

There was talk of adopting it as the C compiler in base for Openbsd some years ago.

I didn't know they considered TCC. However I suppose it doesn't surprise me, the OpenBSD guys had been looking for a successor to GCC for a while. PCC at one time was the biggest candidate. It was actually added to their base and then subsequently removed in 2012. In many ways, Clang was a big bit of luck for them.

Offtopic: If you ever have some time to "fiddle", check out Q3VM: https://github.com/jnz/q3vm
It was the old LCC compiler that id Software modified to output bytecode for Quake 3 (so mods couldn't contain viruses or crash the game). Most impressively, it contains an entire VM to run the generated bytecode in only 2k LOC (https://github.com/jnz/q3vm/blob/master/src/vm/vm.c). Zig or Vlang ontop of this could be quite interesting too.
 

Jose

Daemon

Reaction score: 1,000
Messages: 1,203

I didn't know they considered TCC. However I suppose it doesn't surprise me, the OpenBSD guys had been looking for a successor to GCC for a while. PCC at one time was the biggest candidate. It was actually added to their base and then subsequently removed in 2012. In many ways, Clang was a big bit of luck for them.
You're probably right and I'm confusing TCC and PCC.
 

mrbeastie0x19

Member

Reaction score: 58
Messages: 96

I think that Bellard stopped working on TCC but there is some community around it doing some maintenance. On Windows, I actually still tend to use it. The others are just a mess of online downloaders or POSIX emulation layers whereas TCC holds some simple elegance. It also provides a much more capable tool to provide .dll exports which is very convenient.



I didn't know they considered TCC. However I suppose it doesn't surprise me, the OpenBSD guys had been looking for a successor to GCC for a while. PCC at one time was the biggest candidate. It was actually added to their base and then subsequently removed in 2012. In many ways, Clang was a big bit of luck for them.

Offtopic: If you ever have some time to "fiddle", check out Q3VM: https://github.com/jnz/q3vm
It was the old LCC compiler that id Software modified to output bytecode for Quake 3 (so mods couldn't contain viruses or crash the game). Most impressively, it contains an entire VM to run the generated bytecode in only 2k LOC (https://github.com/jnz/q3vm/blob/master/src/vm/vm.c). Zig or Vlang ontop of this could be quite interesting too.
There were some rumbles a couple years ago from OpenBSD about including Clang because of the switch of license. Iirc they're still not completely happy with the situation.
 

kpedersen

Son of Beastie

Reaction score: 2,095
Messages: 2,953

There were some rumbles a couple years ago from OpenBSD about including Clang because of the switch of license. Iirc they're still not completely happy with the situation.
Yeah, Clang switched licenses after they included it. Whilst it is still more flexible than the GCC one, they seem to not be entirely happy as you mentioned. Looking now, I can't see the issue, it is Apache 2.0. Or was it a contributor agreement they didn't like? Not sure.
 

mrbeastie0x19

Member

Reaction score: 58
Messages: 96

Yeah, Clang switched licenses after they included it. Whilst it is still more flexible than the GCC one, they seem to not be entirely happy as you mentioned. Looking now, I can't see the issue, it is Apache 2.0. Or was it a contributor agreement they didn't like? Not sure.

Under Apache. I don't really understand the objection from what was written, but it's clearly not a long term priority, I just checked the code and it's actually in the GNU directory, which is listed as 'gigantic and monstrous but unavoidable software'

Lol
 

bakul

Active Member

Reaction score: 57
Messages: 119

V looks promising and it is evolving fast... but still at 0.2.4 and still has many bugs. Its GC is optional. V is also used for creating a bare metal OS vinix. The language borrows a lot from Go but interoperates with C much better. See this for comparison with various recent languages: https://vlang.io/compare

I quite it like it so far but I have only kicked its tires. The only way to really know if a new language is worth learning is to learn enough to write more than sample code, which is what I am doing. Some of its engineering seems to make it easy to experiment with it (like Go but better).
 

Jose

Daemon

Reaction score: 1,000
Messages: 1,203

V looks promising and it is evolving fast... but still at 0.2.4 and still has many bugs. Its GC is optional.
Looks like memory management in general is very much a work in progress:
Note: right now autofree is hidden behind the -autofree flag. It will be enabled by default in V 0.3. If autofree is not used, V programs will leak memory.


I guess that's one way of avoiding a garbage collector. Just leak all the memory!

Reading more about it, it seems to be Go+ (not even two pluses.) I'm not enough of a fan of Go to find it interesting.
 

Jose

Daemon

Reaction score: 1,000
Messages: 1,203

Just like C :) You can actually use C.malloc & C.free in V code.
Well, the big difference is C doesn't pretend to do memory management for you. Yeah, I know, it's still in dev, etc., etc. I'm still not impressed and learning a new platform is a big time commitment. It's not something I'm going to do unless I'm paid to do it or it interests me.
 

hruodr

Aspiring Daemon

Reaction score: 277
Messages: 889


Under Apache. I don't really understand the objection from what was written, but it's clearly not a long term priority, I just checked the code and it's actually in the GNU directory, which is listed as 'gigantic and monstrous but unavoidable software'

Lol
Look here at the tone of Theo de Raadt:


He would never accept that tone from someone towards him, just try it in the OpenBSD mailing list.
He can become very rude and insulting for only a question that he considers it may expect
something from him.

I had an experience when I tried to point him out that the disclaimer in his license appears to be
just a one sided declaration and not a condition for the use.

BTW, plan9 is now under MIT License. I like MIT License most.

The plan9 C compilers seems to be hand-written with recursive descent parsers:


People at BSD projects has obviously not the experience and perhaps the wisdom of the UNIX creators.
 
OP
sidetone

sidetone

Daemon

Reaction score: 910
Messages: 1,864

People often use C++ to make up for C's perceived shortcomings in ability. They could write it all in C, but they don't. There needs to be a replacement for both, or at least for C++ and that doesn't have the problems of C++. Then, Rust and languages modeled after Rust have safety features. Rust was a contender until it was realized the problems of it being complicated and of using crates. A language that takes those strengths and is well thought out with this will replace them, or at least it will contend with C++ and Rust before a formidable alternative to C.
 

Alain De Vos

Daemon

Reaction score: 648
Messages: 2,169

People often use C++ to make up for C's perceived shortcomings in ability. They could write it all in C, but they don't. There needs to be a replacement for both, or at least for C++ and that doesn't have the problems of C++. Then, Rust and languages modeled after Rust have safety features. Rust was a contender until it was realized the problems of it being complicated and of using crates. A language that takes those strengths and is well thought out with this will replace them, or at least it will contend with C++ and Rust before a formidable alternative to C.
Let's say you want to create something like a gtk gui. To manage you will need some form of object-orientation.
In plain-C this will remain painfull.
What I hate most are includes with macros expanding into macros expanding into macros ...
 

Alain De Vos

Daemon

Reaction score: 648
Messages: 2,169

For a language to be succesfull you not only need binding to important libraries.
But also documented libraries i.e. a full list of functions and parameters.
And if possible a few simple examples ...
 
Top