#stdlib
Explore tagged Tumblr posts
Text
i think python is *okay* from a language semantics perspective, though the lack of static typing (and mypy isn't nearly as widely adopted as typescript is) hurts, having "len" and "input" be globals was a mistake, and my understanding is that the async stuff in the stdlib is bad
but the packaging system is an unfixable nightmare
15 notes
·
View notes
Text
super cool in-progress programming language: DCS, a functional programming language with a totality checker but not dependent types (unlike the proof assistants that usually have totality checkers). the idea is to allow divergence via a Div effect monad (cf Haskell's IO) while having the bulk of the language guaranteed to terminate. one of the big selling points is that the totality checker works for divide-and-conquer strategies, which Coq etc generally don't.
it can do this because it's based on some very complex type-level machinery where recursive functions are actually (i hope i'm using these words correctly) Mendler-inductive functor algebras. totality checkers require that arguments to recursive calls be smaller than the original argument, but normally enforce that purely based on the syntax of constructors which means they can't go through the function calls required for divide and conquer splits. here, the idea is whenever there would be recursion, it instead uses an opaque type variable and an extra function parameter to enforce that the call can only be to something "recursable", and takes a fixed point so that it ends up back at the original recursive type. (i might try and write more about these if anyone is interested, or to figure out if i actually understand it or if i'm just nodding my head along.)
i don't know if it's possible to pour enough syntactic sugar onto that concept to make it actually usable as a language. but the examples of programs in the language are way more readable than the version displayed in the paper, so it honestly might be. the list file in the stdlib has both quicksort and mergesort, and if you look past the silly decision to use greek letters instead of keywords and the limited pattern-matching it doesn't look that far off a normal recursive function.
my biggest question, though, is how it's possible to take a fixed point of the algebra without risking nontermination. if your totality checker isn't total what's the point?!
40 notes
·
View notes
Text
os idea
might be stupid and impossible but here we go
operating system that can run both elf (linux) and exe (windows) files
has both the linux/unix and windows stdlib
optionally: can somehow differentiate between executables
both windows and linux kernels that are multiplexed (which now that i say this i realize both kernels likely overlap in memory, so this might actually be impossible without major changes, which also may break executables)
7 notes
·
View notes
Text
when you realize you just spent five hours writing something that was already in stdlib
i love pitting classically trained magic users against self-taught magic users in sci-fi/fantasy but it shouldn’t be snobbish disdain for them it should be terror
183K notes
·
View notes
Text
Internet Coder™: We're going to learn some low-level embedded techniques!
Internet Coder™: -heap allocates-
Internet Coder™: -uses OS call-
Internet Coder™: -uses stdlib string function-
Internet Coder™: -generally not careful with memory usage-
Internet Coder™: And that's how you write embedded code!
#I'm mad because I'm trying to find some better design patterns because I've just been cribbing off like...linux kernel and gdb and such#for good c code and like... I'm trying to find more things that aren't just replicating object oriented#so I'm trying to do due diligence and like...there ARE a ton of good resources but so much popular coding bs has buried them#and I'm also mad at a book with embedded in the title assuming use of malloc is ok#bruh i do not have an mmu most of the time i do not have the compute cycles to make that work
1 note
·
View note
Text
Finally got some time earlier this morning to work on my language project, which helped with some of the stress I was feeling. And that's funny to say, because holy hell was this morning's work some of the deepest-cutting agony I've gone through so far.
I finally have a CPython native module compiling from C, which can start to replace my misuse of stdlib ctypes. Source wise, it's going to be a big improvement! I finally have a platform where I can do stuff correctly and coherently - I have my foot in the door. Build system wise, it's jank as fuck and very not-good. I had to temporarily give up on making setuptools work, so I'm building the C modules with Make, so there's no way I could distribute as a wheel without fixing that. UV and Nix fought a lot about how to build and link things. I'm essentially working around every form of proper packaging right now with a promise to myself to figure it out later.
But... it works. I have a Python module written in pure C, which I can import and poke at with pytest, and use as an internal implementation library from the pure Python frontend. Which means I finally have a clean and acceptable boundary between memory management models, instead of the cursed hybrid approach I was using before. Truly a wild amount of effort to represent ASTs with native types, but that effort will immediately pay off with being able to manage the union logic natively. The cool thing about all this, aside from the immediate doors being unlocked with the storage model, is that now there's an inroad for prototyping a bunch of logic for things like the "simplify" function in frontend Python, and seamlessly port them to backend C without changing the test suite. It's also going to make transpilation... well, possible, frankly.
1 note
·
View note
Text
i used to be a real fucking coder man studying c++ stdlib and shit dont get me wrong web development is cool but i miss the more abstract shit
0 notes
Text
C stdlib isn't threadsafe and even safe Rust didn't save us
https://www.edgedb.com/blog/c-stdlib-isn-t-threadsafe-and-even-safe-rust-didn-t-save-us
0 notes
Text
Efficiently Building Production Applications with the Go SDK
Introduction ===================================================== Introducing the Go SDK: A Practical Guide to Using Go in Production Go, also known as Golang, is a statically typed, compiled language developed by Google that has gained immense popularity in recent years. One of the reasons for its widespread adoption is the Go standard library (stdlib), which provides a comprehensive set of…
0 notes
Text
unfortunately for everyone else, you're easy to resurrect, and your cursed (and often outright bad) ways have a special place in my heart
doesn't surprise me C# came for your stdlib considering how every conceivable thing you could imagine, and some you can't, exist in .NET
Chat gimmick blogs are interacting with me what does this mean
2K notes
·
View notes
Link
0 notes
Text

this thumbnail is pretty much a high point of how much I've ever hated clickbait: crudely drawing asscheeks on the C++ logo and the Rust mascot is an incredibly poor life choice that gets worse when paired with a massive outright lie, like, not just the kind of exaggeration we all grind our teeth about but reluctantly accept because clickbait/headlines, no, outright lie. there is no perfect hash table.
what the guy actually says in the video is that you can do a lot better than your stdlib's hash table if you do some profiling and choose a hashing algorithm that performs well for the kind of data that your specific application is going to deal with — which is not inaccurate, but it's vapid because yeah no shit, that's what optimization is, you're trading away generality for performance! your stdlib is always going to look bad in this comparison because the stdlib's main job is to provide generality; optimization is extremely not the stdlib's job because the stdlib doesn't know and can't know what kind of data your specific application is going to deal with. then on top of that, "the perfect hash table" is a lie! that's an actual lie, fuckface! "oh well technically I meant the perfect hash table for my application" THAT IS NOT HOW LANGUAGE WORKS YOU KNOW PERFECTLY WELL HOW IT'S GOING TO BE READ. LIAR! Liar also fucker! Liar in bad faith! Liar perpetrating gratuitous worsening of the world! Liar in Moloch! Liar who leaves a turd in the toilet without flushing and pretends it wasn't him! Liar, liar, liar! Liar who lied on his own account with no Buzzfeed editorial staff to take the blame! Liar who made his own horrible thumbnail and title!
jesus fuck strager why did you make something this bad and then post it. fuck you, I hope your dachshund vomits in your mouth while you're asleep.
1 note
·
View note
Text
Name a function in the Rust stdlib that changed from unsafe to safe without changing its semantics.
Which raid boss in FFXIV was the first to feature a "cutscene" attack that hides the UI?
Give a topological proof of the fundamental theorem of algebra.
Thinking about this metric of like...
Come up with a set of three general-knowledge questions (by general knowledge I mean not stuff about your personal life; roughly the type of information you might find in a Wikipedia article) that you think uniquely narrow you down, in the sense that you feel confident you are the only person on earth who could answer all three questions correctly.
I can think of a few question sets like this for me, where I'm like 80% confident that I'm the only person who knows the answer to all three of them. If you have a little bit of obscure knowledge on a couple of topics, this is fairly easy to do I think.
Well, then the question is, how many meaningfully distinct sets of three questions like this do you have. Call that number your Obscurity Rank.
It's pretty cool to be of high Obscurity Rank, and one should strive for it.
155 notes
·
View notes
Text
An easy way to concurrency and parallelism with Python stdlib
https://www.bitecode.dev/p/the-easy-way-to-concurrency-and-parallelism
0 notes
Text
Linguagem C - Soma de Números Hexadecimais
1 note
·
View note
Text
jackmusclescarier: This is correct behaviour and you can fight me about it. max(a, b, c) gives you the maximal element of a, b, c. The max operation is associative, and it has a unit element, therefore the empty "max" should return the unit element of that operation, just like the empty sum should be 0 and the empty product should be 1.
Like a lot of these JavaScript WTFs, it sort of makes sense if you accept JavaScript's demented premises, but why do we need to do that? There's both an undefined type and an exception system right there, either one of which could've handled the case of "what is the max element of an empty set?"
A while back I posted this:
JavaScript is literally Scheme but with C syntax (a big source of the insanity that makes people crazy about JavaScript is that it's trying to smash together C syntax with Scheme semantics and these things fit together pretty awkwardly).
and people asked me what I meant by it. Well, this is what I meant. This behavior sort of makes sense in Scheme-land, but it's not at all what people expect from C syntax (especially when other JS stdlib functions do return undefined or throw an exception on invalid arguments) and so it's a crazy violation of the principle of least surprise.
Every day against my will I discover new ways JavaScript sucks complete ass.
779 notes
·
View notes