Hacker News new | ask | show | jobs
by bgongfu 2955 days ago
Cixl? :)

I realize the Forth & Lisp heritage might be a bit hard on the brain for those who haven't been exposed before, but what you're asking for is otherwise more or less what Cixl is aiming for.

https://github.com/basic-gongfu/cixl#compiling

2 comments

Wow, cixl is a great thing! I love the Dijkstra quote against complexity that serves as inspiration for the language. However, you find this :

> To build Cixl yourself, you'll need a reasonably modern GCC and CMake installed.

I was very taken aback by this. Really? Why do you really need to depend on the cmake monstrosity? It's just a few lines of C without dependencies that they are distributing!

If there is something about cixl that will scare people is the ridiculous dependence on cmake, not its clean syntax.

I hear you; I'm not overly excited with CMake either, or the C build system story in general.

I spent several years trying to bend regular make into something I was happy with; then I spent several years on top of that using Rake, since at least it allowed me to say what I mean in a sane language. Compared to Rake, CMake is at least semi-standard, provides some kind of macro for most things I want to do, and mostly stays out of my way.

But you definitely have a point when it comes to simplicity and project fit. If someone would be willing to step up and help translate the makefile into something that doesn't look horrible, I'd be more than happy to let it go. Otherwise we'll have to wait until I get enough round tuits, which could take a while given how much remains to be done in Cixl.

Often it is disheartening to bend make to your bidding. But cixl has a neatly arranged tree and the makefile to build it is trivial. The following lines suffice (and by running 'make test -j' you compile everything in parallel and run all the tests) :

    CFLAGS   = -Isrc -O2
    LDLIBS   = -ldl -lm

    SRC      = $(shell ls src/cixl/*.c src/cixl/lib/*.c)
    OBJ      = $(SRC:%.c=%.o)

    src/main : src/main.o $(OBJ)

    clean    : ; $(RM) $(OBJ) src/main

    test: src/main ; for i in tests/*; do ./src/main<$$i; done

would you accept such a patch in your project?
Not bad; my make-fu was never that spectacular to begin with and it hasn't been aging well, this helps me a lot.

Sure thing, if you feel like giving the entire makefile the same treatment I'd be delighted to accept it.

Thanks for taking the time!

What's so bad about cmake? The first time I ever used it, I was very pleasantly impressed by the percentage system.

I take it that cmake tried to tackle autotools, partially succeeded, and partly succumbed to autotools' all-devouring complexity? :)

I just do not understand its point. Cmakefiles are much, much uglier than makefiles. And it takes several steps to compile a program, instead of a single one. And it seems larger than the operating system itself.

I do not know what is "the percentage system", but I doubt it can be so wonderful to make me forget about all the other unnecessary problems.

It may be justified to use cmake when it is really needed. But the cixl interpreter can be built by a five-line makefile.

Ah, I see, a bit more tentativity has been filed away for when I finally check it out.

I was regarding how it outputs progress indication, like

  [ 16%] Building C object ...
  [ 91%] Linking C executable ...
etc (many lines elided). Back on the slow machine I was using when I was very new to Linux, progress indication ("how soon can I stop freaking out about this maybe not working") was very nice to have :D

But (10 years on) I can understand it being icky to use. I guess, ugly as it is, it's a little more structured than automake is, and maybe that's its redeeming quality.

Maybe build systems are the dead-centre of a "sour spot" (opposite of sweet spot) in computer science, with no truly nice solutions out there? (Genuinely curious. The exponential profusion of JS build systems suggests it's rather hard to solve.)

The only explanation I have is that

- Maybe the author is used to cmake

- Maybe this project has Big Goals And Ventures™ syndrome - and, hence, all the enterprise build systems. (Hopefully not, it looks kinda nice)

> Maybe build systems are the dead-centre of a "sour spot" (opposite of sweet spot) in computer science, with no truly nice solutions out there?

I think it's the opposite. It is a very, very sweet spot for which many essentially perfect solutions exist. Then, it attracts all kinds of extreme bikeshedding and produces the monsters we see here and there.

Ooh, okay.

What do you think are the best/"essentially perfect" solution(s)?

(Said as someone who just figured out his first Makefile a couple days ago :P)

Yeah, the syntax is pretty out-of-the-world for me, but I'll give it a go. Thanks!
If you're serious about writing code; I strongly recommend learning some C, Forth & Common Lisp to get an idea of what's possible. Once you have those under your belt, appearances matter less and Cixl will look less crazy banana.