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

All programming conferences are C conferences, if you think about it.


In the same sense that all book fairs are forestry expos.


And you know someone is gonna come along and explain that LISP books are written only on tinfoil, so you're completely wrong.


He is completely wrong because paper is sourced from tree farms, not actual forests. Also I love LISP, Scheme, and Emacs.


A tree farm (at least the type that provide pulp for paper) is just a type of forest. Anyway, where I'm from, paper most definitely comes from forests (mostly second-growth) not anything you would call a "tree farm".


I don't see how that follows at all.

If you're implying all program languages are derived from C, that's simply false. Lisp is based on the lambda calculus and predates C, as one easy counter-example.

If you're implying that all languages run on top of C, that's also false. Theoretical Lisp Machines [0] have been envisioned which do not run C anywhere, and many languages (rust, go, etc) can be built into unikernals that run on real hardware with no C anywhere in the mix.

As far as I can tell, your statement is both pointless and wrong in even a generous interpretation of it.

[0]: https://en.wikipedia.org/wiki/Lisp_machine


Show me a lisp which is used by enough people to fill a conference in 2018 that isn't implemented in C. Show me a lisp machine which was manufactured any time in the past 10 years.


Steel Bank Common Lisp and Clozure Common Lisp are both implemented mostly in Lisp with some C code thrown in. And the European Lisp Symposium always has a large share of Common Lisp programmers.


SBCL (a fork of cmucl) is implemented in common lisp and is the most popular common lisp implementation.



CLOC tells me there's 28391 lines of C and 426525 lines of Lisp in there. Also remember that Lisp has, on average, higher code density than C thanks to advanced macro usage.

Pointing to C code in that repository and saying SBCL is implemented in C is like pointing to https://github.com/sbcl/sbcl/blob/master/binary-distribution... and saying that SBCL is implemented in Bash.


Don't forget that much more of the code is #if'd for different architectures compared to lisp.


The runtime is written in C. That's the important bit. Just because the compiler, standard library, etc, isn't - doesn't mean it's not based on C. You cannot use SBCL without a C compiler.


The installation scripts are written in bash. That's the important bit. Just because the compiler, standard library, etc, isn't - doesn't mean it's not based on bash. You cannot use SBCL without a bash shell. /s

Of course you can use SBCL without a C compiler - you simply use a precompiled version. You can't build SBCL without a C compiler.


Shell scripts just slap commands together. You could just be a human interpreter reading the source and get the job done. C is a much more fundamental requirement of SBCL. Much more so than in the way SCBL depends on Python, for example (e.g. it doesn't).

Listen, I get that in the ivory tower of lisp you don't like looking at the little C bricks at the bottom, but the fact is that they exist and C is a hugely important language upon which the entire modern world of computing is built.


Sure, all of us execute stuff on kernels that are written in either C or C++ or C# or Objective-C, utilizing runtimes that are written in the same languages and calling APIs that are defined by the C application binary interface. That family of languages isn't going anywhere and choosing C instead of raw assembly is often chosen out of practical reasons, such as code maintainability.

Still, I find it hard to put an equality sign between "X has a runtime written in C" and "X is written in C".


I said "implemented" in C. I'd argue that the runtime == the implementation.


The runtime for sbcl is just the garbage collector and parts of the OS interface. It's not like the JVM (or e.g. GNU clisp) where the runtime is interpreting code.

The OS interface for any program that is targeted at *nix is likely to be written at least partly in C, because POSIX is very hostile to non-C languages, which leaves us with the garbage collector.

If the GC's implementation language is the most important thing for an implementation then every language implemented mostly in C++, but using bdwgc for garbage collection is actually implemented in C and assembly.


This doesn't really sound sane to me. In this particular case, it would mean that if you throw away SBCL's compiler, SBCL's standard library, SBCL's extensions, and replace them with something completely different, you still get the same Lisp implementation because all of the aforementioned elements aren't a part of what you call the implementation.


Funny you say that, because Windows libc is actually implemented in C++ with extern "C" {} for the ISO C entry points.


Other implementations have parts of the runtime written in Assembler, Lisp, Java, ...

A bunch of languages can be used to write a Lisp runtime.


The ones based on Java run on the JVM, which is always written in C :) The ones written in Lisp, well, at the bottom it's C again. I haven't seen a popular lisp yet with a meaningful amount of assembly in lieu of C.


> The ones written in Lisp

I have some of these exotic Lisp Machines from the 80s which run no C code by default and where the C compiler is optional and written in Lisp. ;-) Obviously exotic and outdated. An alternate world.

> I haven't seen a popular lisp yet with a meaningful amount of assembly in lieu of C.

https://github.com/Clozure/ccl/tree/master/level-0/ARM

And, yes, the assembler is written in Lisp, too.


You missed "popular". Very cool, though.


Relative to the Lisp world, Clozure CL is relatively 'popular'. ;-)


Which Java VM?

There are plenty to choose from, implement fully in Java like jikes, partially implemented in Java and C++ like OpenJDK, implemented in Java and C like MicroEJ, and lots of other ones to chose from.

Then there is project Metropolis on the OpenJDK, which targets to replace Hotspot with Graal, thus reducing the amount of C++ code on the runtime.


HotSpot is written in C++. I don't know about the other popular JVMs (IBMs thing, Azul, etc) - but I would guess C++ also.


Isn't oracle vm written in C++?


Ah, fair point.


I bet your C compiler is actually written in C++, unless you happen to use tcc.


Well there's Amber I suppose? Not popular, but not in C at least.

https://news.ycombinator.com/item?id=9699065

Uses m-expressions instead of s-expressions though.


> Theoretical Lisp Machines [0] have been envisioned which do not run C anywhere

I have one at home. It's not theoretically, but factually. About 10000 Lisp Machines had been sold between the late 70s and early 90s. Which probably adds to $500+ million in sales - then.

They actually can run C, but that's usually optional.


Okay, I'll amend my position from "Everything is based on C", to "Everything is based on C except for a handful of LISP machines that nobody cares about but a handful of fundamentalists".

At which point someone who collects antique UNIVACs will tell me I'm wrong, too.


C is not the first programming language out there, you know. And for its first decade it wasn't even the most popular. There are still architectures in production and use that you'd struggle to find a conformant C compiler for.

It's really bizarre how you expect the world to revolve around it.


Modern C compilers are written in C++ actually.

IBM z, IBM i and Unisys ClearPath are still quite modern and aren't written in C, rather in memory safe system programming languages.

Then Windows is largely C++ and .NET, even what used to be plain old C nowadays has been migrated to play nicely when compiled with C++ compilers.

Finally there are a couple of embedded and real time OSes that are based on C++, like ARM's mbed or even Arduino libraries.


What on earth are you talking about?

Assembly. Java. Ruby. Python. The list goes on.

Could you explain your rationale behind this statement?


Point me to a compiler or interpreter, any of them, that isn't either written in C or written in something that was written in C. And of course, whatever you play with, it's running on an operating system written in C.

If programming is turtles all the way down, C is the bottom turtle, standing on the solid ground of Von Neumann architecture.

The point is, C is utterly pervasive. Everything that we think is different from C is made from C.


> Point me to a compiler or interpreter, any of them, that isn't either written in C or written in something that was written in C.

Plenty of languages have self-hosting compilers or interpreters available, which are neither written in C nor written in something written in C.

https://en.m.wikipedia.org/wiki/Bootstrapping_(compilers)#Li...

I'm also pretty sure that some are written in C++, whose implementations are usually also written in C++, and which (while closely related to C) is not C.

> And of course, whatever you play with, it's running on an operating system written in C.

That's obviously not the case if what you are playing with is an OS written in not-C. It's actually not entirely true in plenty of cases, because operating systems that use C range from almost-entirely C (with some assembly) to C-among-other-things (e.g., z/OS and it's mix of PL/X, HLASM, and C/C++.)

> If programming is turtles all the way down, C is the bottom turtle

I’m pretty sure the bottom turtle is native machine code and/or processor microcode.


Go is written in Go, which is why you need it installed in the first place before you can run the go compiler.


Bootstrapping problems are interesting/frustrating, especially if you're trying to get a new package into Debian.

If you wanted to build Go from source, what would you build first? What version(s)?

Edit: the documentation is outstanding - https://golang.org/doc/install/source#go14


Except for versions before 1.5, which were written in C.


Spoiler: I hear the first C compilers were probably not written in C, until they were.


The very first C compiler wasn't written in C though.


In that case the first C compiler also didn't compile C.


How exactly is that?


clang, among the most popular C compilers, is itself not written in C, but rather C++.


I think the point that he is making is that most popular modern implementations of assemblers, Java compilers/JVM's, Ruby and Python interpreters are written in C, or in a language which itself was bootstrapped from C, eg. C++.


I guess the point is that the other languages are based on C. From your list CPython, CRuby and the GNU assembler are written in C. Not sure about Java.

Edit: not necessarily agreeing, there must be some languages that do not rely on C.


Java runs on the JVM, which is probably written in C++ (which is C, when you start digging). The widely-used Eclipse J9 JVM is written in C++.


> C++ (which is C, when you start digging).

C++ is not C (it was once implemented as a preprocessor in front of a C compiler, but that's not th same as being C, and it's now more likely to implemented as a self-hosting compiler.)


Ironically enough, the gcc suite itself is partially implemented in C++ these days.




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

Search: