mstdn.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A general-purpose Mastodon server with a 500 character limit. All languages are welcome.

Administered by:

Server stats:

16K
active users

Jan Schaumann

What's Ruby?

An interpreted, multi-paradigm, high-level, general-purpose programming language. You need Rust to build it.

What's Rust?

A compiled, multi-paradigm, high-level, general-purpose programming language. You need Python to build it.

What's Python?

An interpreted, multi-paradigm, high-level, general-purpose programming language.

Do I need, uhm, Perl to build it?

No, but you need Perl to build Rust.

I knew it. What's Perl?

An interpreted, multi-paradigm, high-level, general-

@jschauma FFS when can folks stop making these gratuitous compounding build/bootstrapping dependencies? Ruby needing Rust is probably reasonable. Rust needing Python and Perl is nothing but laziness and cost externalization.

@dalias @jschauma I'd like if it were more common to bootstrap compilers & interpreters and make some basic frontend in GCC to shortcircuit that.

So you get the GCC bootstrap & then instantly can move on to anything.

guix.gnu.org/en/blog/tags/boot

guix.gnu.orgPage 1 — Bootstrapping — Blog — GNU GuixBlog posts about Bootstrapping on GNU Guix.

@lispi314 @dalias @jschauma I try not to over-toot the horn of whatever I happen to be working on, but this seems like a plausible job for Go. Few dependencies, easy cross-platform builds.

@dr2chase @jschauma Yeah, GCCGO is a thing, it isn't up to the current versions but contributions could change that.

@lispi314 @dr2chase @jschauma why do you want GCC in there? What advantage does it bring outside the main toolchain?

@cbehopkins @dr2chase @jschauma It's the main compiler involved in the only reduced binary bootstrap seed project (guix.gnu.org/en/blog/2020/guix) I'm aware of.

As for Golang specifically, it weakens the Google domination, which I find valuable in itself.

Of course, making an interpreter instead of a GCC frontend & using that to compile a self-hosting compiler works too (you still need to compile that interpreter too at some point unless you write in assembler I guess, then you assemble it).

guix.gnu.orgGuix Further Reduces Bootstrap Seed to 25% — 2020 — Blog — GNU GuixBlog posts about GNU Guix.

@cbehopkins @dr2chase @jschauma But then that begs the question, why make yet another compiler instead of reusing the optimization & portability work already done by others before you?

Having a compiler implemented in a safe language is a valid answer to that question, but it does mean you're willing to trade-off portability (or a lot more work to be done) in exchange for it.

@lispi314 @dr2chase @jschauma thanks, think I understand your concerns now, never had to deal with auditability of the toolchain as a concern before.

I guess I don't see c as a safe language, so in many ways, problematic (or maybe that's too many years arguing Misra rules with coworkers ;-))
Thanks

@lispi314 I'm sorry I'm missing something here with you referring to an interpreter in the context of GCC and Go.
If I understand you correctly, the interest is to bootstrap from the minimal possible outside dependencies. (Rather than the ability to bring up the toolchain in a cross platform situation with minimal complications?)
I guess the concern for me in bootstrapping is simplicity, not code size.

@cbehopkins Unauditable code-size, more specifically.

Golang requires Golang to build.

Currently that means that Guix, in order to not accept arbitrary binary blobs from Google to build Golang, has to start from Golang 1.4 & iteratively build each following one up to the current version.

A Golang interpreter or sufficent GCC frontend (like GCCGO is intended to be) would also short-circuit that chain of builds so that one could build the final Go compiler (in Golang) directly.

@cbehopkins @lispi314 @dr2chase @jschauma I'd add portability. You generally need (and already have, by the time you're porting a second language) C anyway, and GCC provides that nicely, so it's probably already there.

Go is available for fewer platforms than GCC, and seems equally difficult to port (never touched it, so IDK). If your language porting story begins with “port the Go compiler and libs first”, you're not going anywhere.

@lispi314 @dalias @jschauma What we really need is a back end for gcc to let it emit Rakudo. Right? /s

@cstross @lispi314 @dalias @jschauma if you're gonna go that far your might as well go all the way to brainfuck

@cstross @dalias @jschauma Ah, Perl 6/Raku to JVM (and another VM I'm unfamiliar with).

You could. Reviving GCJ might make the backend part easier, but you'd still need a whole new frontend.

@lispi314 Do you mean something like #GCCrs?

That got a lot of backlash (from lots of people who said that the approach is bad and completely ignored bootstrapping), but they are going through with it and are making good progress: rust-gcc.github.io/

(me and others told them again and again that what they are doing is great work and two years ago they finally got funding)

@dalias @jschauma

rust-gcc.github.ioGCC Front-End For Rust | Alternative Rust Compiler for GCC

@ArneBab @dalias @jschauma That certainly does look like what I'm suggesting.

It'd make for an alternative bootstrap option usable for instance in #Guix (git.savannah.gnu.org/cgit/guix), but from the project goals it would also eventually become an entirely distinct valid compiler for Rust, which seems quite desirable for me.

git.savannah.gnu.orgrust.scm\packages\gnu - guix.git - GNU Guix and GNU Guix System

@lispi314 sidenote: that #guile bootstrap path was developed for #guix :

GNU Mes (maxwell equations of software) provides a minimal #scheme interpreter and C #compiler with tooling to build #tinycc that can be used with the Mes C library to compile glibc-2.2.5, binutils-2.20.1, gcc-2.95.3 with which you can build the whole #GNU system.

Thanks to #GCCrs that will soon include #Rust

Thanks to #Python on Guile it includes a shortcut for compatible Python-based tooling.
#GCC
@dalias @jschauma

@dalias Ruby needing Rust might be reasonable, but it's not even true 😉 Rust is IIRC only needed to compile with YJIT, which is optional (and I believe still considered experimental)
@jschauma

@rbanffy

That makes me want to write an ultimately self-hosting language with a bootstrap path that looks something like

assembly -> mini-forth -> minimal language -> full language (and then optionally "full language compiler built by a full language compiler", since the full compiler might have optimizations the minimal language compiler doesn't have)

@dalias @jschauma

@jschauma It's turtles - I mean - interpreted, multi-paradigm, high-level, general-purpose programming languages all the way down... 🤪

@miksi @jschauma It ends at Smalltalk, which is written in Smalltalk. Recursive turtles in that case. :-)

@miksi @jschauma Not entirely: Perl depends on C and if you've got gcc and the core GNU utilities (such as make) you're good to go. So the stack has a bottom!

It's still kinda lulz-worthy, though.

@cstross @miksi @jschauma you still need to bootstrap your C compiler...

@cstross @miksi @jschauma gcc uses a tool called autogen to create its makefiles. One of autogen's dependencies is the Guile programming language.

@cstross@wandering.shop @miksi@techhub.social @jschauma@mstdn.social Or the corresponding BSD licence stack on say FreeBSD. (which is as complete, but runs clang)

@miksi @jschauma

I knew learning LOGO was going to be useful someday!

@CGM @jschauma Everything more complex than Forth depends on C, and has since Modula 2 fizzled out. It’s the carbon chain of computing.

@jschauma that's why you should invest time into learning perl. It's available everywhere.

(I'm actually not sure if that's sarcasm or not. #nixos depends on perl so I guess I always have it at hand. I even wrote a perl oneliner this month).

@farcaller @jschauma your computer should have perl installed in the same way that it should have awk: in case someone else was mad enough to use it to build a tool you want, not to actually use yourself.

@petealexharris @jschauma wait, awk is illegal too, now? What's the modern solution to printing the 3rd column of whatever the output is?

@ives @petealexharris @jschauma cut kinda sucks at the job when it's space-padded. Or if I can't visually tell if that's a space or a tab. Awk works all the time every time.

@farcaller @ives @jschauma
I do quite like awk, but I always have Python handy anyway, so unless something is super trivial, it'll be quicker for me to pop up a Python shell than re-read the awk man page.

@farcaller
cat FILE | tr -s ' \t' '\t' | cut ...

heh

@hornlo the lengths people would go for only not to use awk!

@jschauma you could try #mksh (an interpreted, consistent, high-level, general-purpose programming language). To build it you only need C (and a POSIX or classic sh to run the configure script, but to bootstrap you could just set the three dozen or so HAVE_* defines yourself).

@lanodan @jschauma s/it's/its/

Yes, but there’s no better alternative that’s widespread/portable enough, and writing it in the shell-under-test, if even possible, would somewhat defeat the purpose. I’m sure we could add a py3k-based test runner as alternative and keep it up to date wrt. the test spec format, but I’m not volunteering.

You also don’t need to run the tests. (But you really ought to, from what all I’ve seen break…)

@jschauma
What's C?

A compiled, multi-paradigm, high-level, general-purpose programming language. You need C to build it.

What's C?

A compiled, multi-paradigm, high-level, general-purpose programming language. You need C to build it.

What's C?

A compiled, multi-paradigm, high-level, general-purpose programming language. You need C to build it.

What's C?

A compiled, multi-paradigm, high-level, general-purpose programming language. You need C to build it.

What's C?

A compiled, multi-paradigm, high-level, general-purpose programming language. You need C to build it.
@MercurialBlack @jschauma The first "C" compiler was probably written in assembly or BPL, yeah. I put "C" in quotes because it possibly just looked like a heavily macroed assembly code which then got used to write a prettier C compiler and so on and so forth

@ukko @MercurialBlack @jschauma
This is a reasonable history. B was inspired by BCPL, and was running on Multics first, then moved onto UNUX, where it was continually bootstrapped to become C.
en.m.wikipedia.org/wiki/B_(pro

en.m.wikipedia.orgB (programming language) - Wikipedia
@jschauma python crypto is build in rust btw. annoyed gentoo fellows alot.... afaik @mgorny was peak annoyed because of that

@jschauma Last time I looked, GHC (the Haskell compiler) had Perl as a build dependency. But then GHC is written in Haskell, so it already depends on itself ...

@jschauma wow, how did we end up in this mess?

@jschauma I feel like this is the right time to introduce ppl to the Ken Thompson hack: wiki.c2.com/?TheKenThompsonHac

@ives @jschauma
A short thread on the Thompson hack.
I think our group was the only one to detect it.
mstdn.social/@JohnMashey/10999

@jschauma

Let me introduce #julialang, it's a compiled, interactive, multi-paradigm high level computer programming language which builds from C / C++ (it uses LLVM). They are close to removing the scheme interpreter that does the parsing (which is included, and written in C) in favor of a parser in Julia (JuliaSyntax.jl). The vast majority of Julia is written in Julia.