Is that some new-fangled GNU thing? It’s certainly not POSIX.
Is that some new-fangled GNU thing? It’s certainly not POSIX.
Should be \~
in most shells, certainly bash. Use mkdir
and rmdir
when messing around to prevent accidents.
Your ld.so contains:
Entry point address: 0x1d780
EDIT: …with which I meant, modulo brainfart: My libc.so.6
contains a proper entry address, while other libraries are pointing at 0x0
and coredump when executed. libc.so
is a linker script, presumably because GNU compulsively overcomplicates everything.
…I guess that’s enough for the kernel. It might be a linux-only thing, maybe even unintended and well linux doesn’t break userspace.
Speaking of, I was playing it a bit fast and loose: _start
is merely the default symbol name for the entry label, I’m sure nasm and/or ld have ways to set it to something different.
How does executing a program actually work?
Way too long an answer for a lemmy post
It has an executable flag, but what actually happens in the OS when it encounters a file with an executable file?
Depends on OS. Linux will look at the first bytes of the file, either see (ASCII) #!
(called a shebang) or ELF magic, then call the appropriate interpreter with the executable as an argument. When executing e.g. python, it’s going to call /usr/bin/env
with parameters python
and the file name because the shebang was !/usr/bin/env python
.
How does it know to execute “main”?
Compiled C programs are ELF so it will go through the ELF header, figure out which ld.so
to use, then start that so that it will find all the libraries, resolve all dynamic symbols, then do some bookkeeping, and jump to _start
. That is, it doesn’t: main
is a C thing.
Is it possible to have a library that can be called and also executed like a program?
Absolutely. ld.so
is an example of that.. Actually, wait, I’m not so sure any more, I’m getting things mixed up with libdl.so
. In any case ld.so
is an executable with a file extension that makes it look like a library.
EDIT: It does work. My (GNU) libc spits out version info when executed as an executable.
If you want to start looking at the innards like that I would suggest starting here: Hello world in assembly. Note the absence of a main
function, the symbol the kernel actually invokes is _start
, the setup necessary to call a C main
is done by libc.so
. Don’t try to understand GNU’s libc it’s full of hystarical raisins I would suggest musl.
Pure SQL, as in relational algebra, is LOGSPACE/PTIME. Datalog is PTIME-complete when the program (“query”) is fixed, EXPTIME-hard otherwise.
It’s all quite tractable, but there’s definitely turing-complete declerative langugages. Not just pretty much every functional language, but also the likes of prolog.
Functional is also declarative because control flow is implicit/unspecified.
What’s actually missing is logic programming, of which the likes of SQL are a subset.
It’s fine memes are permitted to make jokes and it’s more of a paradigm than vibe coding.
The one paradigm that’s actually missing is logic programming, I would’ve gotten rid of unstructured to include it. The whole paradigm thing really only started with Dijkstra’s rant about unstructured gotos (not the ones C has, in C you can’t jump to the middle of another function).
Not reliably, no. Python is too dynamic to do that kind of thing without solving general program equivalence which is undecidable.
Use a static language, problem solved.
NixOS. Gentoo gets into trouble when you need multiple versions of the same library at the same time. Also while the infrastructure supports it it’s annoying that gentoo doesn’t provide pre-built binaries, like yes some people might want to have reason to build their own bash but I think I’ll be fine with a standard build. NixOS? If you install something usually it’s going to be pre-built. Change a couple of configuration flags? May or may not be pre-built. You want to apply a custom patch? It’s going to seamlessly build from source.
Not really, they’d clash all the time. 8080 is the default port for a non-privileged webserver, that is, web server, something you put your own stuff on, not applications/daemons that happen to have a web interface. E.g. ComfyUI uses 8188 for its web interface, deluge 8112, neither will serve your index.html.
Because PATH_MAX is? Also because it’s a 4k page.
FILENAME_MAX is not safe to use for buffer allocations btw it could be INT_MAX.
255, generally, because null termination. ZFS does 1023, the argument not being “people should have long filenames” but “unicode exists”, ReiserFS 4032, Reiser4 3976. Not that anyone uses Reiser, any more. Also Linux’ PATH_MAX of 4096 still applies. Though that’s in the end just a POSIX define, I’m not sure whether that limit is actually enforced by open(2)… man page speaks of ENAMETOOLONG but doesn’t give a maximum.
It’s not like filesystems couldn’t support it it’s that FS people consider it pointless. ZFS does, in principle, support gigantic file metadata but using it would break use cases like having a separate vdev for your volume’s metadata. What’s the point of having (effectively) separate index drives when your data drives are empty.
See the point about random companies selling it for profit. A patent license does not have to cost anything. Don’t know if AstraZeneca did give it away for free to poor countries which do happen to have the right kind of production capability under a “produce for yourself but don’t sell it” kind of deal, but it’s definitely a thing that you can do.
The patent itself isn’t evil, it’s all about how it’s used. And btw open source licenses rely on copyright law, especially anything GPL-like would not work without it.
I did try to find unit costs for Cuba’s vaccine but failed. While doing that I found a paper analysing distribution costs in Vietnam and long story short it can easily cost four bucks just to get the stuff from the plant into people’s arms.
Not patenting it would allow them to create their own
Patenting it and licensing it also allows them to create their own, but now they need a plant to do that, which requires things like reliable electricity, infrastructure to enable supply of raw materials, whatnot. It’s not like you can brew that kind of thing in a bathtub. What patenting also does is stop random Indian pharma producers from cooking it up and selling it to Botswana without giving you a cut, that is, the wrong private enterprise profiting off it. One that didn’t incur costs doing studies so that regulators would greenlight it.
From what I gather most of the doses used overall in the world were AstraZeneca, and much of it was given to countries for free, with western countries stemming the bill, not AstraZeneca. The EU apparently (it’s in your wiki link) brought the price down to €1.78 because the EU was supplying the production capacity, and €12 for Pfizer/Biontech, which was never in the race for distribution to poor countries in the first place because it requires a tight, and very cool, cooling chain. Forget about the four bucks per dose for distribution in that case.
Would this all have been better in a socialist world? Yes. But that’s not what the situation on the ground was during the pandemic so stop making the perfect the enemy of the good, western countries (excluding the US) were up to the task not getting fucked over by big pharma, and passed that on to other countries.
Meanwhile, in reality, the EU funds lemmy’s development.
If you want a really advanced build system there’s shake, which can deal with things like building things that generates dependency information for things that build things. In a nutshell: It’s strictly more powerful than make because (a single invocation of) make operates on a fixed dependency graph while shake can discover dependencies as it goes.
Mostly though you should use whatever comes with the language you’re using, and if you’re doing something simple use make. That includes “link a multi-language project where the components are generated by language-specific systems”. It notably doesn’t include multi-stage compiler builds. GHC switched from recursive make, which is a bad idea, to non-recursive make, which was… arcane, but at least you didn’t have to make clean
to get a correct build, to shake. Here’s the build system it’s a whole project to itself.
The Nobel prize went to AlphaFold, in case anybody is curious. Protein structure prediction, ML (not LLMs in particular much less a chatbot) is useful for that kind of stuff just as it’s useful in things like physical simulations: Accuracy isn’t as good as the full physical model, but it runs so much faster that you can go through tons more data and actually get somewhere with your research. Better to have a million 99% reliable answers than two 100% reliable ones.
The Nuclear Waste Software License is brilliant. Not only does it make the right impact when publishing random write-only code, it’s legally BSD so lawyers won’t be up your arse about it. In fact, it only strengthens the warranty disclaimer.
Yep exactly that. A fascinating side-effect is that models become better at logic when you tell them to talk like a Vulkan.