Replies: 4 comments 39 replies
-
I'll think more about this and will probably have more feedback as I continue to use Virgil. But in the meantime I'll give some feedback here, based on my work on the Parser Combinator.
Other (non-language) thoughts
My current goal with virgil is to get to the point where I can write a simple (single node) S3 compatible file server (mostly, I just want the most basic features). To that end I'm hoping to write a server application library (built on top of the networking work currently being done). It feels like something that is not very complex but will still be a milestone to get all the required pieces together. More broadly I'm also curious about systems / embedded programming, but I wouldn't have any idea where to start learning about that. So, I'm focusing on higher level / web applications which I'm more familiar with. |
Beta Was this translation helpful? Give feedback.
-
This is a separate thing, but I feel like having an import statement + namespaces/modules will really help larger applications (for example Edit: As an aside, how does one get updates about the "Discussions" tab? Do you have to subscribe to something? I've never used it before. |
Beta Was this translation helpful? Give feedback.
-
Also I think non-nullable types and some form of error propagation would be very useful as well, as we discussed in #111. Specially a native error type + some kind of operator for quickly propagating errors up the call stack, like the |
Beta Was this translation helpful? Give feedback.
-
I am thinking of a construct to make initialization of large, complex structures with named members easier. Some ideas:
|
Beta Was this translation helpful? Give feedback.
-
This is a thread to discuss some ideas for how to improve Virgil from a language design and productivity perspective. I'd like to hear from people who have used the language and what they might find interesting in coming versions. Some features are easier to implement than others, and given that I'm spending most of my time on Wizard and only working on Virgil in the capacity to make it a better systems language, some of these might be more aspirational than others without help.
Generators
One goal is to be able write libraries that are easy to use with terse code. Iteration over something like a
Vector
should look like iterating over an array or a list. E.g.With generators, a sketch:
Function expressions, i.e. lambdas
I started sketching out a syntax for function expressions that can capture variables from the current environment; i.e. they'd be implemented as proper closures. After thinking about many alternatives, including just using the
=>
syntax like JavaScript, which I kind of like, I settled on using thedef
keyword to introducing a function expression. As for the name of the feature, I find that "function expression" is very self-explanatory, including to novice programmers, while "lambda" is understood by those who have a functional PL background. I prefer the self-explanatory, approachable term. But yeah, it's a lambda.Double-arrow function bodies
Related to function expressions, but worthwhile in its own right, perhaps, is using
=>
to be able to define the body of method (and implicitly, its return type) as an expression. This helps with cleaning up additional line noise and making more one liners possible.Transparent structured data definitions
Ongoing work is adding a
struct
concept to Virgil. Structs are not a type in themselves; they are more like a view over memory, either a byte array (safe), or eventually, over raw, non-heap memory (unsafe). Structs are very explicit, requiring every field to have an offset and the overall struct size to be pre-declared.This will make interacting with software and hardware that has fixed memory layouts, like file formats, network packets, and external data structures, much, much easier.
Beta Was this translation helpful? Give feedback.
All reactions