It seems like the language requires Pascal/C89 style declarations on top of the scope. I've never been sure why Pascal developers have stuck to this convention for so long. Is it the zeal to preserve single-pass compilation?
Yes, that's from the Pascal/Modula/Oberon heritage. It's both a design style and a feature to support single-pass compilation (know the stack size and offsets of all parameters and locals before parsing/generating the body). Even that C/C++ are my main languages, I have no problem with declaring variables and nested procedures on top. It's just a matter of taste and getting used to it.
i don't have any problem with that, either. if you are skilled with your text editor, which any developer should be, the slight extra overhead to jump around between definitions and uses is trivial. e.g. use marks and go to mark in vim. or equivalent in emacs. or ...
Because some prefer their programs to compile in a snap without throwing a few clouds at it.
When compilation is that fast, it leads to a different kind of a conversation with the computer. Not necessarily always a better conversation but definitely different.
I'm accustomed to it and even prefer it, but the performance benefits are only meaningful for the most simplistic of compilers supporting the barest of optimizations, like trivial constant folding. Once a compiler builds a whole-function AST, inline declarations have approximately zero cost, and when it starts to perform non-trivial transformations then juggling stack slots comes with the territory.
Such sophistication is also necessary for variable-length arrays, anyhow, especially in loops, so it's presumably no coincidence C99 got inline declarations, compound literals, and VLAs all at the same time.
C hasn't yet fully embraced and leveraged VLAs or the dependent typing features they brought along. That gave them a bad reputation (in crippled form they're all cost for little benefit), unfortunately causing languages like Rust to avoid them. If Rust (and LLVM) had fully embraced them from the beginning, alot of sharp edges wouldn't need to exist in Rust, especially around initialization and statically vs non-statically sized types. Premature optimization (in this case regarding baseline object semantics) is the root of all evil.
An effective workflow to have when you have a fast compiler and a slower, optimizing compiler is to use the former for (interactive) development. Sometimes that would be two different compilers, sometimes the same compiler at different optimization settings.
Once you are happy with the code one can use the optimizing compiler set at a preferred level of optimization.
As an aside, some simple Pascal compilers would not wait for building the full AST before emitting object code.
Sure, but by limiting semantics to preserve the ability to do single-pass compilation or similar implementation optimizations, you're forever shutting the door to some very powerful language features that might only require a moderately more complex compiler, certainly far less complex than what most optimizing compilers end up becoming.
This is why C++ evolves the way it does, and Rust as well. A little more semantic complexity deeper in the language and compiler architecture would unlock tremendously more potential. But because of how the history of C, Pascal, etc has shaped assumptions about primitive typing and object semantics, compilers are invariably architected in a way that higher-order language semantics have to be built in layers above the core compiler and by extension through a meta layer in these more modern languages. Variable length arrays are the prime example; they can only be modeled in C++ and Rust as library interfaces. To implement them as more fundamental primitive types you need a kind of dependent typing ability in the core semantics and compiler implementation. That then necessarily unlocks alot more possibilities for richer language semantics that would be impossible or handicapped otherwise. Alot of the nominally more sophisticated features of C++ and Rust are stilted for just this reason. Rust especially because while far more ambitious than C++, LLVM in many ways is fundamentally built to model what a 1990s C compiler would require, and a few but crucial choices in Rust were motivated by limitations in LLVM.
There are similar problems with how control flow is modeled and reified, but properly resolving them is hindered not only by compiler architecture, but also by OS and hardware abstractions, which like compilers largely coevolved to satisfy the needs of C. Imagine a world where both hardware and OS ubiquitously presumed stack management necessarily required a special register to delimit stack boundaries, independent of VM page size. In such a world we could have space optimal stackful coroutines, and they wouldn't need to be as stilted as in C++ or Rust. That alone would be amazing, but it would trivially open the door to every "bare metal" language having something akin to Goroutines for free, and with maybe some additional work possibly in a language independent manner.
Exactly why I prefer simplicity. Exactly what I don't want my language to become. Single pass compilable does not precluded multiple passes for optimization.
D compiles very fast and has a cleaner design than C++. The latter has been trying hard to be a D wannabe for years. D's is not single pass compiled though.
BTW Modula-2 had coroutines. If I remember correctly they were stackless ones.
> Exactly why I prefer simplicity. Exactly what I don't want my language to become.
My point was part of C++'s complexity stems from the inability to push some of that complexity down the stack. A small amount of added complexity deeper in the broader ecosystem could eliminate much more complexity higher up the stack. Imagine if compilers and ABIs were architected to support efficient passing of discriminants, then option and union types could naturally become first-class and without any anxiety over performance or interoperability, rather than trying to implement them with more complex language facilities.
Languages evolve in a path dependent manner. If it's much more practical (in terms of time and effort) to implement a concept at a certain layer, that's where it'll be implemented. But unless your language is interpreted or emulated and your userbase values purity much greater than performance, the shape of the concept will reflect the capabilities and limitations of where and how it was implemented. The extra complexity of all those little accomodations can add up quickly, both in terms of implementation and language semantics.
It also works both ways. Moving a little complexity up the stack can substantially reduce overall complexity. But which direction is optimal varies. The problem is moving complexity down the stack isn't viewed as a realistic option these days, especially if you must take into consideration the viability of implementing it in core GCC or LLVM.
It is not clear whether you are comparing it specifically to C, but single pass C compilers have certainly existed, including the ones that fuse the C preprocessor with the compiler itself.
Disabling optimisation, can also boost the compilation speed although it won't be as fast.
If, however, the comparison is against more modern languages, such as Rust, Swift, Haskell, ML etc, the actual compute effort goes into type inference, not the multi-stage compilation process, as proving type correctness is a computationally hard problem.
Does runtime async mean stackful coroutines? It's not obvious what exactly the state machines are replaced by, if not automatically inserted yield() calls.
I took it to mean that coroutines are still stackless but that yielding is now an operation the runtime knows about instead of being compiled out by the compiler.
Well, actually they do, but the LLM wouldn't know why. You gotta have used all these to figure it out, and then spend months wondering upon a better design, researching old experiments by random people in archived repos for inspiration. LLMs are useful only for that last part, quickly comprehending a strange repo you found from 15 years ago.
I have a question for people with knowledge of both LLMs and GOFAI: Why can’t we use LLMs to write as many symbolic rules as needed to fit the data while keeping the ruleset reviewable and maintainable?
The amount of finite rules necessary (that the LLM will write) to handle the noise and complexity of real data generates such a dense graph that it breaks the premise of a human-maintainable and auditable system.
sorry this may be way off, but feels analogous to me.
reminds me of http://www.thai-language.com/ (it's safe). it was around long before Google Translate got good enough. i don't know the authors/maintainers, but afaik, everything is entered manually. this is the "analytical" approach to language. most translations before Google Translate went full ML used an analytical approach.
anyway, long story short, turns out "analyzing" a language to "understand" it GREATLY underperforms probabilistic/statistical methods like ML.
also reminds me of trying to label parts of speech in Vietnamese. there's a school of thought that finds it useful...then there's another school of thought that plainly points out words that can be verbs, nouns, adjectives all in different contexts.
Ignoring the history, does spaces solves this problem or are permissions going to remain an issue? I was thinking of doing a project that is going to require a solid permissions system and was thinking of using ATProto.
Spaces left a number of core authorization building blocks out of the protocol. Those will need to be implemented in "user space" and I expect a number of different approaches will be attempted. I also expect this to become fragmented.
I shared my vision for what it could have been in the first ATProto Private Data WG: https://www.youtube.com/watch?v=oYKA85oZc8U&t=3812s (basically Zanzibar, UCANN is also interesting) I have ideas for a new protocol that would be permissioned, more federated, but still draw on the good parts of atproto. It's geared towards small social (think discord server / facebook groups) than big social (most common apps we think of - with reposts, quotes, blocks - features I have sworn off).
The Bluesky team didn't join the conversation until pretty late and then picked their own proposal (blog post series, was not formal at that point).
Are there any plans to add HTTPS clone/push support? For those who want to self-host their own Knots, an obvious approach is to put them behind Cloudflare. And being SSH only makes that complicated.
> Claude Code for VS Code extension on the Cursor Marketplace
So Cursor is running its own extension repository? Or is this the official VS Code repository and the incident report just happens to focus on Cursor for some reason?
VS Code doesn't allow forks to use their marketplace, I think. At least with VSCodium, they don't. I think they even patch a workaround where you could download almost all extensions' .vsix files.
1. If only Cursor Marketplace version was compromised, how was it published in the first place?
2. If the Cursor Marketplace version was released from an "official Anthropic" account, whose to say OpenVSX and/or VSCode versions are not compromised?
The affected versions have been pulled down, so no one really knows. The way I see it, only Cursor has admitted to have been compromised.
reply