Live data from Hacker News

4coder editor is now fully open source

github.com

101–108 of 108 posts

Re: 4coder editor is now fully open source

#101
post #96

Earlier quoted context omitted.

> then on a practical level I recommend not using a build system at all, and just writing a super simple shell script (unity builds are easier there too). But the minute you introduce someone who is familiar with windows or prefers an IDE workflow this falls apart. You are also limited to the platforms, compilers and IDEs that you write the script to support. That's not flexible, that's inflexible. Also, cmake has su…

Writing a new “call the compiler like so” line is pretty easy — pretty flexible, I’d say. Let’s say a new compiler came along tomorrow, where all the options have plus signs instead of minus signs (“+O +DPREPROCESSOR_DEFINITION”), I’d have an easier time adding a single line to a script than I would writing a toolchain file for CMake, or more likely, having to look at the CMake source code. That is a not unreasonable…

> If you have very precise requirements, especially regarding order of arguments on the command line

Then write those arguments in that order with target_compile_options?

> The easiest pathway is to generate compile_commands.json — ironically, this is already something extremely close to the script, so it’s trivial to automatically generate from the script

You keep saying it's trivial to extend it to do X and to do Y, and yet it's even more trivial with cmake - it already does it. At a certain point you've just poorly reimplemented something else

I've never had to add support for a brand new c++ compiler to cmake personally, so I'll have to trust that yes it's easier to modify your she'll svript to support that, but given that 99% of my build systems work is generating IDE files and building with MSVC, GCC and clang (even across servers, mobile devices and consoles), ill continue to recommend the system that works for that rather than a hypothetical new c++ compiler that will likely require more time spent on conforming the code than modifying a cmake file.

Re: 4coder editor is now fully open source

#102

Earlier quoted context omitted.

Writing a new “call the compiler like so” line is pretty easy — pretty flexible, I’d say. Let’s say a new compiler came along tomorrow, where all the options have plus signs instead of minus signs (“+O +DPREPROCESSOR_DEFINITION”), I’d have an easier time adding a single line to a script than I would writing a toolchain file for CMake, or more likely, having to look at the CMake source code. That is a not unreasonable…

> If you have very precise requirements, especially regarding order of arguments on the command line Then write those arguments in that order with target_compile_options? > The easiest pathway is to generate compile_commands.json — ironically, this is already something extremely close to the script, so it’s trivial to automatically generate from the script You keep saying it's trivial to extend it to do X and to do Y…

I’ve repeatedly wasted hours on issues intrinsic to CMake (not respecting options, overriding my options by passing contradictory ones in a way that’s beyond my control, etc., but also you guessed it, bugs in CMake, or issues with its awful and poorly thought out language). I’ve never had issues intrinsic to a script that just calls gcc or what have you. Any issues I’ve had with builds using scripts are to do with learning how a specific compiler works, something I have to do anyway, and therefore it’s never wasted. Sometimes but rarely enough, I even use CMake as a starting point (especially if I can’t access my previous scripts right at that moment), but I just extract the resulting commands, write the script, and delete the CMakeLists.txt.

I have ported scripts to use `zig cc` (though that uses a gcc/clang-like set of options by design, so easy in CMake also), and `tcc` (again gcc/clang-like, but only supporting a small subset of options, so with a script, I can just remove those arguments and the “port” is done — suppressing options CMake wants to give is harder).

As for poorly re-implementing something CMake already does, I disagree when CMake doesn’t do all that much (CMake’s language is not great at doing much beyond specifying basic target options). Writing compile_commands.json for a gcc toolchain is a one-liner callout to python, just `print(json.dumps({“directory”:sys.argv[1], “arguments”: argv[2:], “file”: argv[-1]}))` given the same arguments as that `build` function from earlier. This tiny extra up-front cost reaps rewards for every ship cycle where you don’t have to fight with the tool, or even learn it in the first place (think about issues like passing -D options to CMake, then reconfiguring the build in the same build dir but with different options — does this always work or do what you expect? in my experience, absolutely not). I won’t complain about the general quality of typical CMakeLists.txt files because the general quality of scripts isn’t great either! But it’s nice to limit the number of poorly taught and therefore poorly written scripting languages involved in the build, and shell is far more generally applicable, so it’s a worthwhile investment compared to CMake/meson/waf/b2/xmake/bazel/whatever else is coming down the pipe. (If you’re a massive organization, we’re talking collaboration across the globe in ways that exceed normal methods of human collaboration, and that result in monumental build times and complexity, then invest in a fancy tool like bazel, it’ll probably be worth it for you).

I’m perfectly happy for people to continue to use CMake, so I’m not saying other opinions are wrong, and I wouldn’t immediately proselytize a team to switch away if I joined it — one of the reasons I don’t tend to use it is because focusing on build tools is a huge time sink, but it’s also a time sink to start a debate about transitioning to a script. But I’m happy not having to deal with it in many situations.

Re: 4coder editor is now fully open source

#103
post #100
post #89

Earlier quoted context omitted.

What do you mean by that?

In Smalltalk there is no such thing as source files. Your program is an image which can be freely modified and dumped. Look at Pharo[1] which is a modern Smalltalk environment. You start it up and create classes in the IDE, but never do you create "source files". [1] https://pharo.org/

"6.18 Saving code in a file" Pharo 9 by Example, page 75

https://books.google.com/books?id=hfpwEAAAQBAJ&lpg=PA75&ots=...

> In Smalltalk there is no such thing as source files...

    $ cat fact.st
    Stdio stdout 
        nextPutAll: 100 factorial printString; 
        nextPut: Character lf.!
    SmalltalkImage current snapshot: false andQuit: true!

    $ bin/pharo --headless Pharo10-SNAPSHOT-64bit-502addc.image fact.st
    93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000

Re: 4coder editor is now fully open source

#104
post #100
post #89

Earlier quoted context omitted.

What do you mean by that?

In Smalltalk there is no such thing as source files. Your program is an image which can be freely modified and dumped. Look at Pharo[1] which is a modern Smalltalk environment. You start it up and create classes in the IDE, but never do you create "source files". [1] https://pharo.org/

Damn, that sounds really cool. The IDE has some amazing features too. The IDE states that you can modify the program while it's running is that actually working well? Cause it seems like a very volatile feature that can go very poorly.

Re: 4coder editor is now fully open source

#105
post #104
post #100

Earlier quoted context omitted.

In Smalltalk there is no such thing as source files. Your program is an image which can be freely modified and dumped. Look at Pharo[1] which is a modern Smalltalk environment. You start it up and create classes in the IDE, but never do you create "source files". [1] https://pharo.org/

Damn, that sounds really cool. The IDE has some amazing features too. The IDE states that you can modify the program while it's running is that actually working well? Cause it seems like a very volatile feature that can go very poorly.

Just because you can doesn't mean you must — it depends on your process.

https://en.wikipedia.org/wiki/Hot_swapping#Software

Re: 4coder editor is now fully open source

#106
post #104
post #100

Earlier quoted context omitted.

In Smalltalk there is no such thing as source files. Your program is an image which can be freely modified and dumped. Look at Pharo[1] which is a modern Smalltalk environment. You start it up and create classes in the IDE, but never do you create "source files". [1] https://pharo.org/

Damn, that sounds really cool. The IDE has some amazing features too. The IDE states that you can modify the program while it's running is that actually working well? Cause it seems like a very volatile feature that can go very poorly.

> The IDE states that you can modify the program while it's running is that actually working well? Cause it seems like a very volatile feature that can go very poorly.

It's actually a paradigm that works well in many programming languages besides Smalltalk such as Common Lisp, but for some reason seems to be forgotten with "modern" and "trendy" programming languages. Except for.... JavaScript!

Re: 4coder editor is now fully open source

#107
post #103
post #100

Earlier quoted context omitted.

In Smalltalk there is no such thing as source files. Your program is an image which can be freely modified and dumped. Look at Pharo[1] which is a modern Smalltalk environment. You start it up and create classes in the IDE, but never do you create "source files". [1] https://pharo.org/

"6.18 Saving code in a file" Pharo 9 by Example, page 75 https://books.google.com/books?id=hfpwEAAAQBAJ&lpg=PA75&ots=... > In Smalltalk there is no such thing as source files... $ cat fact.st Stdio stdout nextPutAll: 100 factorial printString; nextPut: Character lf.! SmalltalkImage current snapshot: false andQuit: true! $ bin/pharo --headless Pharo10-SNAPSHOT-64bit-502addc.image fact.st 933262154439441526816992388562…

I was obviously simplifying it for my explanation as I didn't want to write a story. Yes you can file-out and file-in but thats not the primary mode of operation when working with the IDE.

Re: 4coder editor is now fully open source

#108
post #107
post #103

Earlier quoted context omitted.

"6.18 Saving code in a file" Pharo 9 by Example, page 75 https://books.google.com/books?id=hfpwEAAAQBAJ&lpg=PA75&ots=... > In Smalltalk there is no such thing as source files... $ cat fact.st Stdio stdout nextPutAll: 100 factorial printString; nextPut: Character lf.! SmalltalkImage current snapshot: false andQuit: true! $ bin/pharo --headless Pharo10-SNAPSHOT-64bit-502addc.image fact.st 933262154439441526816992388562…

I was obviously simplifying it for my explanation as I didn't want to write a story. Yes you can file-out and file-in but thats not the primary mode of operation when working with the IDE.

Look where that wrong explanation leads —

"#1 it's a burden of knowledge to shift from the Unix filesystem to the Smalltalk runtime. There... are no files."

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

"Pharo by Example" doesn't need a wrong explanation —

"It may seem like the image file should be the key mechanism for storing and managing software projects, but in practice that is not the case at all. There are much better tools for managing code and sharing software that is developed in a team. Images are useful, but you should be very cavalier about creating and throwing away images."

"2.5 Saving, quitting and restarting a Pharo session" Pharo 9 by Example, page 14

https://books.google.com/books?id=hfpwEAAAQBAJ&lpg=PA75&dq=p...

Post reply on HN