Oh, I use the terminal a lot, it doesn’t throw me off. When I can’t have vscode (e.g. small openwrt devices) I can use vim. It’s just plain easier to use vscode for editing files when I can
- 2 Posts
- 60 Comments
It’s there and it’s easy. Most people don’t use terminal text editors unless they are SSHing in a server, and they would only do that sporadically, so it makes no sense to become proficient in a complex text editor like vim or Emacs for that little use case.
Sidenote: personally, I learned vim once, and used it extensively every day for two years. I stopped using it for one year and was back to square one. Now I use vscode for everything… Even when I’m using SSH, because vscode supports SSH
Hey Claude, what does “int open parenthesis asterisk fun closed parenthesis open parenthesis int c comma char asterisk asterisk v closed parenthesis equal get open parenthesis closed parenthesis minus greater sign fun semicolon” means?
Yeah, I also only learned natural deduction, until I got to the languages course and the professor told us “this is similar to natural deduction, but different”.
Personally I don’t like lean, I prefer coq. But that’s mostly the vibes, both are actually fine. Lean doesn’t do constructive logic, it does classic logic, but you have to give up program extraction for that. That’s why mathematicians are head over heels for lean.
*it
Chatgpt is a thing, not a person
edinbruh@feddit.itto
Programmer Humor@programming.dev•An appropriate amount of work to slap an MIT license on somebody else's workEnglish
8·2 months agoNot at all. I would not expect any riir project to reimplement the entire stack in rust. This is not calling a random C dependency. This is literally calling the OS’s API. Literally there’s just this and the kernel.
As you said its goal is to rewrite a C codebase. The C codebase is coreutils. The correct way to getuser is to use the OS’s API, which happens to be inside libc.so, which has nothing to do with coreutils, it’s an entirely different codebase. End of the story. The OS’s API needs to be exposed as a c library, because c is the only language that can be imported from any other language. If you were to rewrite it in rust, it would use
extern 'C'and it could not be any other way. And uutils would still import it from libc.Maybe one day we’ll see a rust rewrite of libc (tho it doesn’t make much sense), but this has nothing to do with uutils.
If you are asking for a rust wrapper around the correct way to getuser, you have literally posted it. You can find it in uutils.
Also, being compliant is just being compliant. I wouldn’t expect it to be called something like POSIX.rs unless it were implementing every part of POSIX. Which is clearly not what we have here. Or are you suggesting that bash should be called POSIX.c, because it’s in c and it’s POSIX compliant?
edinbruh@feddit.itto
Programmer Humor@programming.dev•An appropriate amount of work to slap an MIT license on somebody else's workEnglish
7·2 months agoWell, if you want to be pedantic, I’ll entertain you a bit more.
You see, C and Unix were “born” together. So sometimes, POSIX intertwines them in weird ways. In this case, getlogin is declared in unistd.h because it’s part of the Unix standard API, however the POSIX standard states that it must be implemented in libc. So the POSIX compliant way to getlogin is to call into libc, which doesn’t need to be glibc, you could use musl and avoid the GNU dependencies. If rust’s stdlib were to offer a getlogin function, the proper approach would be to still call libc. It’s like if on windows you were to call into Win32 to getuser, except on *nix it’s the same file as libc.
If you want to replace the getlogin implementation, the POSIX compliant place to do it is not in coreutils but in libc, like the aforementioned musl library does.
So the key here is that getlogin is not art of the c system API. It is actually part of the POSIX APIs, it is just “located” inside of libc, which by the way, does not need to be GNU if you are concerned with uutils’ philosophy.
edinbruh@feddit.itto
Programmer Humor@programming.dev•An appropriate amount of work to slap an MIT license on somebody else's workEnglish
12·2 months agoI would like to interject for a moment. What you are referring to as coreutils Is actually coreutils+libc+Linux… And fill the rest yourself.
The “anti rust” crowd spends half of their time yapping about how you still need c in some places, then why did you get upset with calling into libc here? Are you suggesting to rewrite every rust program in C so you can have only c calling into c?
I’ll give you a fast-forward of the subjects you need to study to actually learn this stuff (with links). Many of these are part of typical computer science curriculums. However, most will exclude at least some of this to its fullest. Note that it’s a lot of knowledge, you might find it frustrating to just deep dive into it on your own, don’t take it the wrong way, maybe follow an actual course and you will be guided into all of this. Maybe I’ll also try to give a run-down, skipping the preupedeitic knowledge… later… if I have time.
P.s.: to get the general feeling you don’t really need to know all of this tho. Just skim it. And dive deeper if you like it.
- Any respectable computer scientist needs to know at least some first order logic https://en.wikipedia.org/wiki/First-order_logic
- Read the semantics part. You don’t need everything, but you must understand what it means for a Formula to be a logic consequence of a set of formulas
- Read a bit the deductive systems part. I find “natural deduction” (in detail here https://en.wikipedia.org/wiki/Natural_deduction) easier to understand (more… Natural) however, your mileage may vary, many people find it confusing, hence why “sequent calculus” was invented. We’ll use the sequent calculus later
- You need to know lambda calculus https://en.wikipedia.org/wiki/Lambda_calculus
If you know any functional programming language it will be easier, but it’s optional
- You can learn it on its own, but it fits better as part of a “foundations of computer science” course. I don’t have a link for that.
- You also need to know a bit of programming in basically any strongly-typed language. This will give you some kind of general idea of what types and type systems are.
- Now you can put together what you know of types and sequent calculus, and learn what type derivation rule are https://en.wikipedia.org/wiki/Typing_rule
- Now you understand the meme
- You can also check out what type systems are as a whole https://en.wikipedia.org/wiki/Type_system
- We have skipped Curry-Howard, but you can see how typing rules look a lot like logic deduction rules, in particular sequent calculus
- Hooray, time for Curry-Howard https://en.wikipedia.org/wiki/Curry–Howard_correspondence they basically notice the same similarity you just noted, but take it a step further, they can do it because they know other logics other than first order logic
- The next step, if you are interested, are theorem provers, which are the direct application of the correspondence https://en.wikipedia.org/wiki/Proof_assistant
- Check out rocq or agda
- Any respectable computer scientist needs to know at least some first order logic https://en.wikipedia.org/wiki/First-order_logic
deleted by creator
Well, instead of stealing from the drivers, to give to a corporation, it steals from tourists to give to drivers. I say it’s not good but it’s still less bad
Yeah, we are a bureaucracy machine.
People (especially us) often make fun of how convoluted our bureaucracy is, but this has made us extremely good at paper moving. If any country had a go at being us, they would collapse.
Italy. Because you need a license to be a taxi driver, and a random company cannot hand them out (and the taxi drivers union is powerful and corrupt). And because the government gotta know who is renting a room where, you can’t just go wherever you want without anyone knowing, especially foreigners. Whenever you rent a room in Italy, the owner will take a picture of your ID/passport, and send your data to the local government. Also you gotta pay taxes on the rooms you rent.
It doesn’t have to be like this though.
Here, for example, Uber is not allowed and Airbnbs are regulated
Ideally, we wouldn’t build infinite compute, just as much as we are actually using, and using it efficiently allows you to build less. We would still need datacenters even without LLMs, but they wouldn’t need to be so gargantuan, because even the worst, inefficient, nodejs-based, intern-written server you could ever encounter, would be heaps more efficient (or at least less demanding) than any LLM. This is true even from an economical point of view, or any practical point of view, not just environmental.
To quote Tannenbaum: “You know you have the right computer when you are always using 99% of it. If you are using 100%, you are being limited by the machine. If you are using 98% you have bought more than you need”. If datacenters were always running at 40%, we would build bigger ones.
edinbruh@feddit.itto
Programmer Humor@programming.dev•rust blasphemy (added context)English
131·5 months agoYeah, like, who would ever want to
stuff1()?.map(stuff2);It’s much better to just:
err, value = stuff1(); if err == nil return err, nil; if value != nil stuff2(value);And you might even:
for a in vec { vec[a] }
edinbruh@feddit.itto
Programmer Humor@programming.dev•WHERE THE FUCK IS THE CURSOR?English
81·6 months agoOn KDE and on MacOS, if you shake the cursor it becomes larger
edinbruh@feddit.itto
Programmer Humor@programming.dev•You're missing at least fiveEnglish
2·6 months agoSometimes banks give you a PEC address, but it’s mostly for communicating with the bank, and you are paying for it as part of the bank’s services.

And instead vscode supports SSH (without quotes), you can connect to an SSH host, and it will open files and folders on the host like it does locally. And if you open the integrated terminal it will run on the remote host. And it will forward the git login agent so you can commit or push with the credentials of your local machine. And it can forward ports from the remote.