3 ms·
What I wonder is: why has nobody noticed that code editors lack a concept of 0? When you're writing code, you can express any concept except that of an unfille
by conartist6 1mo ago
What I wonder is: why has nobody noticed that code editors lack a concept of 0?
When you're writing code, you can express any concept except that of an unfilled hole. We've rearranged every part of the coding process in a twisted-up way, all for the lack of a way to express lack.
If you want to be more clear about what I mean, look to tools which can express holes like https://scratch.mit.edu https://scratch.mit.edu and https://hazel.org https://hazel.org. They give the feeling of letting things snap together like lego bricks. Indeed, lego bricks themselves function because of the negative space (the holes) in them!
- onestay42 1mo agoHow about an `extern` variable in C?
- conartist6 1mo agoA million variations exist. I'm looking for a programming-language-agnostic concept. The closest you'll find are templating languages like Handlebars
- skew-aberration 1mo agoDelimited continuations? Though I'm not totally clear what you're asking for. Semantics or syntax?
- deleted 1mo ago[deleted]
- conartist6isme 1mo agoSyntax. Delimited continuations would be a similar concept but for semantics
- Someone 1mo agoFunction arguments are unfilled holes. So are interface declarations. Both are (fairly) programming language agnostic, but in the context of an editor, would become specific. The editor would have to know _how_ to represent them in the code’s language.
- mungoman2 1mo agoThis could be interesting but too vague for me to understand what you mean. Could it be explained more clearly, or link some blog entry?
- conartist6 1mo agoYeah, I will. I'm being a bit coy because I already have a very specific solution in mind which would be a lot like Scratch, but unifying those ideas with syntax. It should be fully ready to share quite soon.
- rmunn 1mo agoHave you also looked at Snap! (https://snap.berkeley.edu/ https://snap.berkeley.edu/), by any chance? It's basically Scratch but with the artificial limitations removed, e.g. you can pass lists to functions, and blocks (functions) are treated as first-class objects so you can store them in data structures, pass them as input to other functions, and basically teach students proper functional-programming thinking (to find the odd numbers in this list, just pass the "is odd?" block as input to the "filter" block and you're done).
- dosisking 1mo agoLike Madlibs?
- conartist6isme 1mo agoUgh I got rate limited so I had to make a new acct just to post this reply: Sure! Like mad libs if you couldn't be sure if _____ was a missing part or the text what was meant to be there. In a mad lib it's obvious, but with code it may be less obvious. You certainly can't just use _ with code. Even the nil code point is allowed in some programming languages' source code (e.g. rust).
- protocolture 1mo agoI dont understand. I feel like somewhere between zero, null, false, a null pointer or an uninstantiated reference we have a few methods to define nothing.
- conartist6 1mo agoHere's my example: in JS code, what does // mean? Is it the start of a line comment or the empty regex? The difference between them is nothing. If you could write nothing as _, one would be /_/ and one would be //_
- protocolture 1mo agoYou want a character that stands in for theres no character here?
- conartist6 1mo agoYes. If we could find some such character that was completely safe all the time, we would have a system of universal templating for all programming languages. ...but we can basically prove to ourselves that we'll never find any completely safe unicode code point to use for the purpose that will never be in conflict with the syntax of any language. ...so are we done for? Nah, we just need an embedding