Live data from Hacker News

The first new build of Circle, a new C++20 compiler, since April 2022 is online

github.com

31–40 of 80 posts

Re: The first new build of Circle, a new C++20 compiler, since April 2022 is online

#31
post #29

First the acknowledgement: to produce this amount of work single handedly - the guy is undisputed genius. do not want to go through the whole article but have this question: fn ParseAsInt() The goal for this new languages like Rust, Carbon, Go etc. is to introduce "better" alternatives to C and C++ languages and move the developers over. Nothing is wrong with that. Now to syntax: I completely understand syntax constr…

[deleted]

Re: The first new build of Circle, a new C++20 compiler, since April 2022 is online

#32
post #30
post #29

First the acknowledgement: to produce this amount of work single handedly - the guy is undisputed genius. do not want to go through the whole article but have this question: fn ParseAsInt() The goal for this new languages like Rust, Carbon, Go etc. is to introduce "better" alternatives to C and C++ languages and move the developers over. Nothing is wrong with that. Now to syntax: I completely understand syntax constr…

Guess it simplifies parsing, e.g. infamous "most vexing parse" etc.

Convenience should be for users of a tool not creator. And if it is fn than why not function instead. This single / double character constructs / modifiers in my opinion reduce readability. When reading Rust code apostrophe modifier for example is hard to see.

Re: The first new build of Circle, a new C++20 compiler, since April 2022 is online

#33
post #29

First the acknowledgement: to produce this amount of work single handedly - the guy is undisputed genius. do not want to go through the whole article but have this question: fn ParseAsInt() The goal for this new languages like Rust, Carbon, Go etc. is to introduce "better" alternatives to C and C++ languages and move the developers over. Nothing is wrong with that. Now to syntax: I completely understand syntax constr…

I think the author is simply showing that Circle can implement Carbon syntax using its metaprogramming capabilities on top of C++. It is not making a statement that the syntax itself is desirable.

Re: The first new build of Circle, a new C++20 compiler, since April 2022 is online

#34
post #16

Earlier quoted context omitted.

I agree that safety should affect API design, which means that there is at least one major piece missing after the rewrite. Either the ability to switch to an even stricter type system (e.g. Rust) or a ~zero cost binding generator to a stricter language (again, e.g. Rust). However, before reaching that point, piecewise refactoring is something of considerable value. There are huge C++ codebases lying around that I be…

Scala and F# are safer than Rust since they're on a VM.

As far as I understand, both these languages are subject to data races whereas (safe) Rust is not.

Now, Scala is a JVM language and so presumably you get Java's rules, you aren't Sequentially Consistent but the damage is constrained - however human programmers still can't successfully reason about this state in non-trivial programs.

Re: The first new build of Circle, a new C++20 compiler, since April 2022 is online

#35
post #14

Earlier quoted context omitted.

> Circle did the interpreted, compile-time pass idea before any of the other new systems languages. constexpr is in C++11, Jai is from 2014, and Zig 0.1.1 is from 2017. This project looks quite cool though.

With the small difference that Circle can use the complete language at compile time, constexpr is still far from it, and also gave birth to constinit and consteval.

Jai gets to use the entire language.

constexpr in C++ 11 is indeed very limited, arguably even more than Rust's const functions today.

Re: The first new build of Circle, a new C++20 compiler, since April 2022 is online

#36

Now, solve package management and I'll be ready to be back on board the C++ train!

I usually hate Microsoft tools but, vcpkg works really well. Easy enough to use from a couple of build systems, too

Can't comment on Conan but, I hear it's nice

Re: The first new build of Circle, a new C++20 compiler, since April 2022 is online

#37
post #16

Earlier quoted context omitted.

I agree that safety should affect API design, which means that there is at least one major piece missing after the rewrite. Either the ability to switch to an even stricter type system (e.g. Rust) or a ~zero cost binding generator to a stricter language (again, e.g. Rust). However, before reaching that point, piecewise refactoring is something of considerable value. There are huge C++ codebases lying around that I be…

C++ templates cannot be reused or rewritten piecemeal in a new language, it's practically impossible. There's a reason why the Rust folks were very careful to separate out generics from the more flexible case of macros (that come in both rewrite-based and procedural varieties).

Out of the box, they can't, but I can imagine mitigations for that, if you have robust enough static analysis on your new language. For many cases, it's fairly trivial to generate a piece of .cpp that simply instantiates a template for a specific type and can be linked against.

Of course:

- this doesn't cross library boundaries;

- this assumes robust enough static analysis, which is not possible in the general case, since templates are non-decidable in the general case – so you need to restrict your new language to more reasonable semantics;

- let's not even get started on the interaction between templates and C-style macros – at some point, you need to throw the towel.

Re: The first new build of Circle, a new C++20 compiler, since April 2022 is online

#38
post #16

Earlier quoted context omitted.

I agree that safety should affect API design, which means that there is at least one major piece missing after the rewrite. Either the ability to switch to an even stricter type system (e.g. Rust) or a ~zero cost binding generator to a stricter language (again, e.g. Rust). However, before reaching that point, piecewise refactoring is something of considerable value. There are huge C++ codebases lying around that I be…

Scala and F# are safer than Rust since they're on a VM.

>> Scala and F# are safer than Rust since they're on a VM.

Do you have any evidence to back up your claim?

Both the JVM (Scala's VM) and the CLR (F#'s VM) have a history of vulnerabilities:

https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=java+hotspo...

https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=dotnet+clr

Programming languages running on VM is not a safety guarantee.

Re: The first new build of Circle, a new C++20 compiler, since April 2022 is online

#39

Earlier quoted context omitted.

Scala and F# are safer than Rust since they're on a VM.

As far as I understand, both these languages are subject to data races whereas (safe) Rust is not. Now, Scala is a JVM language and so presumably you get Java's rules, you aren't Sequentially Consistent but the damage is constrained - however human programmers still can't successfully reason about this state in non-trivial programs.

There are plenty of other races that Rust doesn't provide any help, and those are much more relevant in distributed computing workloads.

Re: The first new build of Circle, a new C++20 compiler, since April 2022 is online

#40

Earlier quoted context omitted.

Scala and F# are safer than Rust since they're on a VM.

>> Scala and F# are safer than Rust since they're on a VM. Do you have any evidence to back up your claim? Both the JVM (Scala's VM) and the CLR (F#'s VM) have a history of vulnerabilities: https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=java+hotspo... https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=dotnet+clr Programming languages running on VM is not a safety guarantee.

Well, it is the same 30% that Rust also cannot help much.
Post reply on HN