Earlier quoted context omitted.
The point was that logically it would be an array lookup by index. There's no need for any conditional construct here whatsoever. You'll note it has already constructed a string in the right order to do that, but then copped out with the if-else.
True enough. On that note, I had a look at the language reference - there's arrays - but also this: (char_at s index) # Get ASCII value at index (0-based) (string_from_char code) # Create string from ASCII value So, you can pluck a character... From an UTF-8 string? What if the rendering used multibyte characters?
Nanolang: A tiny experimental language designed to be targeted by coding LLMs
161–170 of 210 posts
Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs
#162Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs
#163Earlier quoted context omitted.
True enough. On that note, I had a look at the language reference - there's arrays - but also this: (char_at s index) # Get ASCII value at index (0-based) (string_from_char code) # Create string from ASCII value So, you can pluck a character... From an UTF-8 string? What if the rendering used multibyte characters?
Well, we can see the string, and we can see that is uses plain ASCII.
Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs
#164Earlier quoted context omitted.
Ah, people are starting to see the light. This is something that could be distilled from some industries like aviation, where specification of software (requirements, architecture documents, etc.) is even more important that the software itself. The problem is that natural language is in itself ambiguous, and people don't really grasp the importance of clear specification (how many times I have repeated to put units…
You can use LLMs as specification compilers. They are quite good at finding ambiguities in specs and writing out lists of questions for the author to answer, or inferring sensible defaults in explicitly called out ways.
And is doesn't matter how many times you tell them the implementation and, more importantly, the tests needs to 100% follow the spec they'll still write tests to match the buggy code or just ignore bugs completely until you call them out on it and/or watch them like a hawk.
Maybe I'm just holding it wrong, who knows?
Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs
#165At this point, I am starting to feel like we don’t need new languages, but new ways to create specifications. I have a hypothesis that an LLM can act as a pseudocode to code translator, where the pseudocode can tolerate a mixture of code-like and natural language specification. The benefit being that it formalizes the human as the specifier (which must be done anyway) and the llm as the code writer. This also might e…
It's just part of the software lifecycle. People think their job is to "write code" and that means everything becomes more and more features, more abstractions, more complex, more "five different ways to do one thing".
Many many examples, C++, Java esp circa 2000-2010 and on and on and on. There's no hope for older languages. We need simpler languages.
Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs
#166At this point, I am starting to feel like we don’t need new languages, but new ways to create specifications. I have a hypothesis that an LLM can act as a pseudocode to code translator, where the pseudocode can tolerate a mixture of code-like and natural language specification. The benefit being that it formalizes the human as the specifier (which must be done anyway) and the llm as the code writer. This also might e…
I disagree I think we always need new languages. Every language over time becomes more and more unnecessarily complex. It's just part of the software lifecycle. People think their job is to "write code" and that means everything becomes more and more features, more abstractions, more complex, more "five different ways to do one thing". Many many examples, C++, Java esp circa 2000-2010 and on and on and on. There's no…
Of course someone eventually will, so I might as well: Well, except for lisp-likes. I think the main reason programming languages grow and grow, is because people want to use them in "new" (sometimes new-new, sometimes existing) ways, and how you add new language features to a programming language? You change the core of the language in some way.
What if instead you made it really easy to change the core language from the language itself, when you need to, without impacting other parts of the codebase? Usually if you use a language from the lisp-"family" of languages, you'll be able to.
So instead of the programming language everyone is using grows regardless if you need it or not, it can stay simple and relatively small for everyone, while for the people who need it, they can grow their own hairballs "locally" (or be solid engineers and avoid hairballs in the first place, requires tenure/similar though).
Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs
#167At this point, I am starting to feel like we don’t need new languages, but new ways to create specifications. I have a hypothesis that an LLM can act as a pseudocode to code translator, where the pseudocode can tolerate a mixture of code-like and natural language specification. The benefit being that it formalizes the human as the specifier (which must be done anyway) and the llm as the code writer. This also might e…
I disagree I think we always need new languages. Every language over time becomes more and more unnecessarily complex. It's just part of the software lifecycle. People think their job is to "write code" and that means everything becomes more and more features, more abstractions, more complex, more "five different ways to do one thing". Many many examples, C++, Java esp circa 2000-2010 and on and on and on. There's no…
Just this week, I decided to start learning Kotlin because I want to build a mobile app.
Everything was going great until I reached lambda functions.
Honestly, I can't wrap my head around either their purpose or their syntax. I find them incredibly confusing. Right now, they feel like something that was invented purely to confuse developers.
I know this might just be one of those topics where you suddenly have an "aha" moment and everything clicks, but so far, that moment hasn't come.
Did anyone else coming from older, more imperative languages struggle this much with lambdas? Any tips or mental models that helped you finally "get" them?
Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs
#168Earlier quoted context omitted.
What we need is a programming language that defines the diff to be applied upon the existing codebase to the same degree of unambiguity as the codebase itself. That is, in the same way that event sourcing materializes a state from a series of change events, this language needs to materialize a codebase from a series of "modification instructions". Different models may materialize a different codebase using the same s…
I am working on that https://github.com/gritzko/librdx Conflictless merge and overlay branches (ie freely attachable/detachable by a click). That was the pie-in-the-sky of the CRDT community for maybe 15 years. My current approach is RDX tree CRDT effectively mapping to the AST tree of the program. Like CRDT DOM for the AST, because line based diffs are too clumsy for that. Back in the day, JetBrains tried revision-c…
Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs
#169At this point, I am starting to feel like we don’t need new languages, but new ways to create specifications. I have a hypothesis that an LLM can act as a pseudocode to code translator, where the pseudocode can tolerate a mixture of code-like and natural language specification. The benefit being that it formalizes the human as the specifier (which must be done anyway) and the llm as the code writer. This also might e…
This is where LLMs slip up. I need a higher-level spec language where I don't have to specify to an LLM that I want the jpeg crop to be lossless if possible. It's doubly obvious that I wouldn't want it to be lossy, especially because making it lossy likely makes the resulting files larger. This is not obvious to an LLM, but it's absolutely obvious if our objects are users and user value.
A truly higher-level spec language compiler would recognize when actual functionality disappeared when a feature was removed, and would weigh the value of that functionality within the value framework of the hypothetical user. It would be able to recognize the value of redundant functionality by putting a value on user accessibility - how many ways can the user reach that functionality? How does it advertise itself?
We still haven't even thought about it properly. It's that "software engineering" thing that we were in a continual argument about whether it existed or not.
Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs
#170I am using a variation of spec-driven development.