Scripting languages of the future
jntrnr.com
jntrnr.com
Dreaming here: Lua is a fantastic scripting language, but the Rust FFI isn’t as ergonomic as it could be. Enter Luster [2], which is basically LuaJIT rewritten in Rust.
Embedding a scripting language in a Rust application gives you tons of power (e.g. scripting Rust structs from Lua [3]), and setting this up isn’t terribly difficult.
[1]: https://github.com/vrtbl/passerine
I work on Passerine, cool to see the language mentioned in the wild, glad you like it!
> Written in Rust, and I suspect scripting Rust libraries is in the cards.
We have a rudimentary FFI to Rust already in place. We're also working on a proc macro lib for creating high-level bindings to Rust types/functions/crates (currently unreleased). Also working on an algebraic-effect-based system-injection engine, which will replace the FFI in the 0.10.0 or 0.11.0 release :)
---
I'm building on the side one (https://tablam.org) that is focused in the "crud" kind of apps and exist a lot of low-hanging fruit there. Simple stuff like making the paradigm relational/array from the start, support for decimals (and money and quantities?), in-built auto-vectorization (that comes almost for free when adding a bit of array languages) and a lot of other stuff I can't even explored yet.
Current scripting languages are not there yet in ergonomic or features to the kind of apps we actually do (ie: The popular ones, you bet niche experiments like mine are there on way or another).
---
And the challenge is even harder today!. In the article is mentioned better support for IDEs, that is more thought that I have expected!. This requiere a more sophisticate parsing pipeline and not much experience there around...
Also: Concurrency/parallelims. I don't think exist a truly nice ergonomic there. Sure, async/await is a little better, but none of the things I have experienced (with exception of SQL and magic) is something I could give to a "scripting user". You still need a complicated understanding of this, plus how express that in code.
Plus: Performance. Is possible to build very fast "scripting" languages! But is VERY hard to be fast across many workloads :(
And is terrible, because the kind of developers don't use them (C/c++ cough) will complain LOUDLY how terrible them are, and how you must not use them, when certain workload is not as optimal!
“scripting” is an application domain, and a scripting language is one focussed on that domain (and, yes, its a domain with blurry boundaries.)
“interpreted/compiled” is a (blurred, sure) implementation distinction.
scripting languages tend to be interpreted, but talking about scripting vs. compiled is conflating two different axes of description.
Js has been for years but I thought both Python, PHP and Ruby were working in that direction. That sounds like all the major ones to me.
For scripting, a shout out to Dart CLI:
I've built entire prototypes in Groovy at amazing speeds and then gradually replaced individual files with Java/Kotlin code and made sure the entire thing still worked. When I had grabbed everything of value I copied the resulting Java/Kotlin files to the real codebase and deleted the prototype. I could've left them in Groovy, too, as it is quite performant enough, alas customers preferred Java/Kotlin.
That argument turned out to be more or less nonsense - if supporting language features forever is really an issue why have so many features been added to JavaScript?
But even so I think it was probably a good thing it didn't become a web standard because Dart has become way way better than it ever could have been had it been standardised.
Modern Dart is great. The problem now is that so is modern Typescript. Especially if you use it via Deno - in a lot of ways it is better than Dart.
I really like Dart and I wish it was more popular but I think it's too late for it to have any hope of beating Typescript.
- I wanted static types that felt dynamic, which meant being able to infer types from a file as long as the file path can be determined at compile time.
- I wanted Dataframes to be a first-class container since the high-level of abstraction leads to great performance when doing analytics.
Therefore, I created a language with statically typed Dataframes. Empirical can infer a CSV's type at compile time, namely because it performs compile-time function evaluation automatically. The result is a language that runs easily in a REPL but can be used for long-running scripts without worrying about common programming errors.
And no doubt some advances will be necessary in terms of AI to handle the calculations. I don’t know what those calculations are, but I’m sure they’re difficult :)
I think about the voice interface to the various computers. Really complex interactions. Always on. Rapidly changing contexts. Historic conversations. Different languages.
I’m sure storage is an issue. Something to do with compression algorithms. And decompression. Probably encryption and security.
Challenges in redundancy might be hardware or materials problems.
Most of them are hard for me to even articulate plainly :)
Thanks for answering!
I was just clarifying the GP comment
> I sometimes wonder to myself: what programming challenges would come up in something like the starship Enterprise (any of them) and what new language constructs (if any) would be required to address them?
The point of the question is to imagine that you are part of the team building this system. What sort of programming techniques would you be using? Is it going to be Python? Modern C++? Probably none of these things as they are incredibly inadequate for such a system.
If done today I think it's more than one technology. The missions critical stuff could maybe be Ada? The AI stuff maybe logical programming based like Prolog? I assume there's a big database in there.
That origin has really been lost, and people went on to give scripting languages a life of their own.
For me C++ is C#, and while I generally try to apply this language everywhere, my Perl equivalent would probably be Powershell. For some it might be C++ and Ruby, or Rust and Python.
I think there's enough work to be done in this field that there's going to be room for plenty of Python, Javascript, and other scripting language codebases.
New languages are all going to look pretty similar to what came before, because those raised on them are going to borrow elements that they're familiar with. Just like for me how the ideal programming language is or would look a lot like C#. As long as a language fits your technical needs on maintenance and performance grounds, and has the abstractions and keywords to properly express your ideas, it really doesn't matter what it looks like.
I guess they are just helping us to keep our C++ skills up to date. /s
All the code has to be revriten every few years when a new language version and a new language of the week becomes popular, and the code written in Perl in 1994 still works.
My Python 2.7 code still runs in Python 2.7 so I'm a little unclear on your point in general.
Its not, though, its a JS/TS runtime. JS and TS are the languages, not Deno.
These could be solved with a sufficiently smart JIT. but the task is not a trivial one.
var data = [[2,3],[4,5],[6,7],[8,9]];
data = data.map(([a,b])=>{let l = Math.hypot(a,b); return [a/l,b/l];});
In instances like this it should be possible for a JIT to modify data in place without allocating any new objects. Similarly should data be large enough A JIT could process the transformation on multiple cores.A reference counting Garbage collector would have an edge. Alternatively a language could crafted to provide more context for the JIT to do it's work. Having a clear distinction between mutable and immutable and being able to specify that functions are pure. These would assist a great deal.
Theoretically they would use structural sharing for their implementation which should reduce the overhead of creating a whole new array of objects like that
Meanwhile webdevs reinvent things from 40 years ago and struggle to build 2D form apps.
A lot of people have an aversion for anything visual programming. Usually when someone mentions Blueprints (here or on r/gamedev on reddit) I see a whole slew of replies talking about how bad it is, how nobody makes any real things with it[1] and how visual programming is terrible. Of course, they're all programmers who forget that textual programming isn't for everyone and that visual languages are extremely successful in other fields (especially for artists and musicians).
I'm a programmer with ~20 years of textual language programming under my belt, but I spent a few months with Max/MSP and personally, I loved it. I'm a very visual thinker, I often think on paper or whiteboards with boxes and lines and I found that when using Max, I could skip this thinking step and go directly to code. Sure, its not for everyone, but for me, it was a very pleasant experience.
Yes, Max isn't a good replacement for a general purpose programming language and Blueprints apparently also has its warts, but they are extremely useful and successful and I do agree that we will see more like this in the future. I do feel that a good general purpose visual language could be created[2] Even Blender is moving that direction with its "nodes everywhere" thing.
[1] Despite projects like this being written entirely in Blueprints: https://www.youtube.com/c/RaymondCripps Also the Bloodborne PS1 demake: https://www.youtube.com/channel/UCaxcBWED_UhcjhoG7nUeUoA
[2] At the time, my big complaints with Max were lack of general purpose data structures (and reference types allowing you to build stuff like trees yourself -- although you could write C/C++ extensions and presumably create such things there), no tools for unit testing etc, afaik its added a bunch of data structures since so maybe its a lot closer now?
But TypeScript is good enough for me right now. It's like writing JavaScript without the constant need to keep everything type related in my head at all times.
The gradual typing is onto something, as it lets us migrate from the quick-n-dirty "science project" up to a non-trivial codebase.
IDEs seem like a "maybe". We want to generate code gracefully as text files.
Yet, I haven't seen a language include real amounts of Unicode in its syntax. With an IDE to enter/render more expressive characters, we could see code that is more explanatory at a glance (short of a full APL experience).
Raku does in terms of built-in operators (but all of them also have ASCII n-gram names), which aren't quite syntax (because Raku is a language where operators are not syntax but identifiers.) Agda uses Unicode fairly freely (again, for built-in identifiers, not syntax per se.)
> The question then is - what if you created a programming language from the start to have this kind of support? No need for transpilers, while also having stronger engine integration and maybe even better runtime errors?
You mean like Python 3?
Personally I never understood the complaint. The standard library is pretty decent and well documented. Sure there is lots of historical cruft and inconsistencies but I would be way more annoyed if it got changed.
But JavaScript, as an actual scripting language, has been pretty primitive. It is only now starting to become a real candidate for actual scripting. There's imo crufty not very great options like shelljs[1]. But by adding a tagged-template string for system() for calling things, and a little bit of standard library, the recent ZX has made JS a much more interesting & competent scripting language[2].
I like the idea of the topic, exploring it. But the author feels off in a number of places.
> What TypeScript showed is that you could join together the idea of a flexible lightweight (and optional!) type system onto an existing programming language, and do so successfully. . . .The question then is - what if you created a programming language from the start to have this kind of support?
Personally I just don't think languages matter very much. They're very similar, by & large. They have different tooling, packaging, somewhat different looks/feels for executing code, and their standard libraries are different. But TypeScript is popular & fast at least 90% because it is JS, because it works with JS things. Arguing that we should try to recreate TypeScript apart from JS sounds like a mind blowing waste of time. Also, Deno has good integrated TypeScript support.
On the topic of easy parallelism, JavaScript promises are imo quite easy to stitch together & use & quite available.
One of the main issues I see with easy-parallelism is that it's too easy: there's too many cases for uncontrolled parallelism. Throwing tarn.js or other worker-pools at problems seems all too common. But one is still left stitching together each pool/stage of work. I'd like to see SEDA[3] like architectures emerge, and perhaps get added to something like ZX standard library.
[1] https://github.com/shelljs/shelljs
[2] https://github.com/google/zx
[3] https://en.wikipedia.org/wiki/Staged_event-driven_architectu...