Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Rewriting it in Rust is the obvious choice.


The worst choice. Rust doesn't compile under OpenBSD i386. Dillo runs even on PPC and some m68k platforms. If any, maye FLTK + C.

On C++ compilers, clang++ it's much faster than g++ under legacy platforms. Clang uses far less RAM and CPU than GCC while compiling.

I know we have no cproc/cparser or tcc for C++, but at least clang it's usable with 1GB of RAM.


I just compiled some C++ code using G++ under ulimit -v 108032, but it didn't use much of the STL. For a simple example program using iostream, vector, unique_ptr, and std::string, I needed more, but had success with ulimit -v 262144: http://canonical.org/~kragen/sw/dev3/docentes.cc.

The last "real" C++ code I wrote was probably the modular softsynth in http://canonical.org/~kragen/sw/dev3/sweetdreams-c++.cc (see http://canonical.org/~kragen/sw/dev3/sweetdreams.html for an explanation) which also compiles successfully in under 256MiB of virtual memory (¼GiB). But that's still under 500 lines of code.

I'm not sure how much RAM you need to compile G++ itself. More, I imagine. I was definitely compiling versions of GCC long before I ever saw a machine with so much RAM as 1GB, but I am guessing you probably need at least 1GiB for recent versions, maybe 4GiB.

LLVM, which is required for both clang and Rust, is much heavier. You definitely can't compile current versions of LLVM on i386, m68k, or any 32-bit platform anymore. You can get it to cross-compile to them as targets. In theory there are PPC64 machines that have enough address space to build it, but I'm not sure anyone ever made a PPC64 machine with enough physical RAM to build it in a practical span of time.


I run OpenBSD 7.8 under an i386 ATOM netbook, n270 CPU and 1GB of RAM. I hav no Rust, but I have C++, JimTCL, nim (I compled Chawan). Go runs, too. Maybe I can't compile LLVM in my netbook, but a tuned up machine with 2-4GB of RAM might be able to do such task with a bit of swap in a SSD and boosted up login.conf limits.


Maybe so, but I think it would have to be an amd64 CPU rather than an i386. Maybe you could do it inside of QEMU; does QEMU running on i386 permit emulating address spaces larger than 4GiB?


If you run PAE and enable ZRAM, You can probably handle it by booting a 32 bit OS under a 64 bit machine as you state.


cproc/tcc/scc/etc are C compilers not c++.

If you want to compile a recent c++ compiler (gcc/clang), you must have already a c++ compiler (one of the biggest mistake in open source software ever was to move gcc to c++, clang doing the wrong thing right from the start...).

You can start to compile gcc 4.7.4, the last gcc compiler with buggy c++98 you could compile with a C compiler (you will need to patch it, and even unroll its full SDK), then you will have to compile at least 2 gccs to reach the last gcc. This insane mess is due to the infinite versions of c++ ISO "standard", introducing tons of feature creep which will force you to "upgrade" (mostly no real good reasons, namely developer tantrums, or planned obsolescence).

This is disgusting, Big Tech grade abomination of software engineering, shame on the people who did that and those in power who are not trying to fix it (probably the GCC steering committee).


Rewriting GCC's C++ codebase in C is also not realistic.


I pointed out that some people seems to get good results at porting c++ to C using "AI"(LLM).

And big mistakes require big fixing.


Yeah, we doin', big pimpin', we spendin' cheese

Big pimpin' on B-L-A-D’s, we doin'

Big pimpin' up in NYC

It's just that Jigga Man, Pimp C and B-U-N B


Rust it's worse for that; for full reproducibility you almost need to create a release-centipede from an old GCC-rs (or GCC) compilable release to the current one. At least that's the norm under Guix.

On cproc, cparser, I meant that we have no lightweight c++ compilers and sadly the closest to cparser in lightness it's clang++, because it's either that or the g++ behemoth.


In the light of all that, there are still people unable to understand why computer languages with ultra-complex syntaxes are really an issue (c++, microsoft rust, etc...)


More like complex, overloaded. ML languages have a complex syntax but are manageable. OTOH, on Lisp, about bloated languages like Common Lisp compared to Scheme, you don't have to follow all the Common Lisp Hyperspec in order to create something; a subset would be pretty fine, even without CLOS. Scheme IMHO it's worse with SRFI's with tons of opaque numbers in order to guess what does that. And don't let me start on Guile modules vs the Chicken ones...

People rants about CL being a bit 'huge', but with the introduction to the Symbolic Computation book and Paradigms of Artificial Intelligence Programming you are almost done except for a few modules from QuickLisp (CL's CPAN/PIP), such as bordeaux-threads, usockets and MCClim for an UI, which will run everywhere.

C++ templates can be far more complex than Common Lisp macros. At least with CL you have a REPL to trivially debug and inspect then. Clang and GCC just recently began to introduce * understandable* help and error messages over template parsing walls...


Rust compilers are an even bigger dependency than C++ compilers.


Microsoft rust is not that much worse than c++.

That said, it seems some people get nice results at porting from c++ to C using "AI" (LLM?).


If fltk had C bindings it would have been a thing long ago, because usually C programs will run faster than their C++ counterparts. DIllo's requeriments would be far smaller (and Dillo runs on potatos, I won't be surprised if it still runs on i486 machines)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: