37 ms·
Val, a high-level systems programming language
- kubota 3y agoPart of me loves the advent of so many zero-cost-abstraction languages. The other part wishes the systems programmers would pick a winner already so that the already small community of systems programmers do not end up multifurcated into even smaller communities of Rust, Zig, Val, etc developers. I hope the systems language wars end soon in other words.
- eska 3y agoMaybe we picked one too early and didn’t have enough innovation in this area for too long. Bring the war :)
- djbusby 3y agoNot even a war, right tools for the job. I don't think it's possible for one language to rule them all. Options are good.
- packetlost 3y agoI like Rust, but damn is it complicated and very heavy. I really just want C with namespaces, actual enums (tagged unions are a bonus), a "modern" type system, and proper package management. They all have their place, IMO it's not that hard to switch between languages.
- skywal_l 3y agohttps://ziglang.org/ https://ziglang.org/ ?
- pjmlp 3y agoYou're in luck, C++ covers that.
- csjh 3y agoC++ has proper package management?
- pjmlp 3y agovcpkg and conan nowadays. Not using one of them is making oneselfs live difficult on purpose.
- dgb23 3y agoI think when someone says „I want a C that’s cleaner and has some simple, generally loved features“ they don’t think of C++?
- pjmlp 3y agoProbably not, but they should. C already felt primitive in the mid-1990's, and by C++98 most of those features were available. So they can use C++ for those fixes, with its JavaScript/TypeScript kind of symbiotic relationship for better or worse, or stick to C and keep waiting for such language, that will most likely require parsing include files with some kind of tooling.
- packetlost 3y agoI didn't mention, but minimal is something I desire in a language too. Honestly, C++ is such a "design by committee" kitchen sink language that I have no interest in ever touching it. Yes, you can restrict yourself to a subset of the language, but then every time you need a library, or need to find some info on how to do something on SO or whatever, you have to deal with the rest of the language. You cannot simply ignore it because everyone else won't.
- pjmlp 3y agoThere is also a bit of committee on everything WG14 does since C89.
- chrisco255 3y agoWon't happen. But all the more reason to expand wasm + wasi support everywhere.
- jjtheblunt 3y agoAre those languages able to do low-level hardware things?
- deleted 3y ago[deleted]
- tracker1 3y agoNot really, unless some future hardware supports such a beast, could be an interesting approach for AI/WebGPU interfaces. It's more for service-oriented applications currently... you pass stuff in, get stuff out.
- chrisco255 3y agoWasm is WebAssembly, which has a nice compact set of instructions to compile to and network effects from being the 4th language of the web to ensure its staying power. WASI is a WASM system interface for connecting with hardware and other systems: https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/ https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webas...
- anyfoo 3y agoIt rather looks like WASI interfaces to code which is written in one of the other system programming languages that are the topic in this thread, so I guess the answer to the parent commenter's question is "no"? Am I misinterpreting this?
- chrisco255 3y agoIf you want to be pedantic, sure. The point is whether those interfaces are written in C or Go or Rust that they are interoperable, and a dev can write their core logic with a wasm compilation target in Zig, Val, or whatever other language comes up. Hardware and OS devs can write WASI modules in whatever language they prefer so that others can consume.
- VWWHFSfQ 3y agoI think at this point Rust is the winner just because it's already overcome the incredible hurdles of being shipped in the Linux and Windows kernels themselves. In that regard, I doubt there's room for any more of these new systems languages now.
- bsaul 3y agoI have the intuition that rust can’t possibly be the winner, it really feels too crude regarding the way it manages lifetimes. It really feels like the clumsy grandparent of the language that will indeed solve those problems elegantly.
- germandiago 3y agoSame opinion here. Let us look at Val and Vale. There is also Carbon and CppFront but those are more of C++ evolution than new-born things.
- lolinder 3y agoBut we made do with C for how many years? OP's question isn't whether Rust is as good as systems languages will get, the question is whether any successor language stands a chance of being included in the kernels. The bad ergonomics of C were never enough to get another language into the Linux kernel, it took a language that solves the number one class of security bugs. It's unclear that any successor to Rust will be able to show as clear a need.
- xwowsersx 3y agoThat's not how I read OP's question. OP was wondering whether a lang besides Rust can be "the winner" (unqualified) given that Rust has already passed the hurdle of being included in the kernel. It didn't sound like at all like their question was limited to whether there's room for another lang in the kernel.
- kjs3 3y agoBut we made do with C for how many years? K&R C was, what, 1972...and it's 2023 now. So that's 51 years with no definitive end of 'making do' in sight.
- xmonkee 3y agoThis is one of the better (and better looking) landing pages I have seen for a programming language. Very good copywriting too.
- Buttons840 3y agoI agree. I had to look up all the other new languages that start with V, because I feared missing out, and I liked Val's page best.
- corysama 3y agoI might actually be more excited about Val as a C++ successor than I am about Herb Sutter's excellent CppFront... Admittedly, all I know about it is from the two presentations below. But, from what I can tell... Statically compiled. Statically typed. Interops with C++. Memory safe. Typesafe. Data-race-free. The elevator pitch I give when describing it goes like this: Imagine you were starting a new C++ project and didn't really care about performance (spoiler: perf comes back in the end). So, you decide to not bother using pointers or references anywhere. You just pass by value, return by value everywhere, all day long. If you ignored the obvious perf problems of passing around maps of vectors of objects by value, wouldn't it be nice? you don't have to worry about side effects or data races or anything. And yet, the data is not immutable. You can go ahead and mutate it all you want worry-free because the data is all completely local to your function. Well, turns out the Val folks have figured out that by eliminating pointers and references from the language, the can get the compiler to automatically pass-by-const-reference and return-value-optimization under the hood such that it preserves both the performance and the semantics that you want at the same time. Val: A Safe Language to Interoperate with C++ - Dimitri Racordon - CppCon 2022 https://www.youtube.com/watch?v=ws-Z8xKbP4w https://www.youtube.com/watch?v=ws-Z8xKbP4w https://cppcast.com/val-and-mutable-value-semantics/ https://cppcast.com/val-and-mutable-value-semantics/
- pjmlp 3y agoListen to the last two episodes of ADSP Podcast with Sean Parent, regarding Val. Adobe Research labs is seriously sponsoring its development. https://adspthepodcast.com/ https://adspthepodcast.com/
- marcodiego 3y ago> Statically compiled. Statically typed. Interops with C++. Memory safe. Typesafe. Data-race-free. So it is for C++ what rust is for C?
- tialaramex 3y agoVal has a similar but different strategy to the big problem as Rust. In Rust the reference semantics are lifetime checked (hence all the talk about a "borrow checker") but in Val there are no reference semantics. In Rust there are some things you can't (safely) do because the checker can't see why they're ok. Val guesses that, with appropriate language features in place, you can extend that to everything and still have a useful language but now you don't need to teach this complicated and difficult feature. Because Val is young it's not yet obvious whether this is basically always better, or whether it's too limited.
- dang 3y agoRelated. Others? Val, a new programing language inspired by Swift and Rust - https://news.ycombinator.com/item?id=31788527 https://news.ycombinator.com/item?id=31788527 - June 2022 (19 comments)
- mr_00ff00 3y agoIt’s brought up every time, but the only thing I don’t like about Val is that Vale and V are two other systems languages that are also new. Those three can so easily be mixed up because of naming.
- jgilias 3y agoThere’s also Vala. A somewhat different niche, but one more similarly named language.
- epage 3y agoHad to go to the link to confirm whether this was the projection language or the region language.
- khaledh 3y agoThere's also VAL: Variable Assembly Language https://en.m.wikipedia.org/wiki/Variable_Assembly_Language https://en.m.wikipedia.org/wiki/Variable_Assembly_Language
- cloudmike 3y agoMy emotional journey with Val having just learned about it today: Oh neat, a new systems language, probably nothing but let's take a peek. Docs look legit. Hmm some thoughtful ideas in here around ownership. Syntax makes sense. But is it different enough to justify its own existence? Who makes it? Oooh, Dave Abrahams is working on it. We crossed paths at Apple and I remember his Crusty talk about Swift [1]. It was great, loved the strong opinions, but Apple sadly removed it years later because it had some outdated advice. Wait, he's at Adobe now? So is this an Adobe language? Conclusion: keep an eye on it, will watch the linked talks, wait and see. [1] edit: I found the Crusty talk! "I don't do Object Oriented!" https://www.youtube.com/watch?v=p3zo4ptMBiQ https://www.youtube.com/watch?v=p3zo4ptMBiQ
- sanderjd 3y agoHa, I really loved this style of describing the journey. More people should write like this :)
- gpderetta 3y agoBefore his time at Apple, David Abrahams was very prominent Boost contributor, a member of the C++ committee and a strong proponent of Stepanov-style generic programming. He ending up in the Val project is not surprising!
- andrewstuart 3y agoAnyone got an opinion on Embedded C++, a C++ subset/dialect? https://en.wikipedia.org/wiki/Embedded_C%2B%2B https://en.wikipedia.org/wiki/Embedded_C%2B%2B
- andrewstuart 3y agoedit: these comments are general, not directed at Val. A humble suggestion to anyone coming up with a new language. Please make it as familiar as possible. For example, do you really need to come up with some new syntax for defining a function, or specifying types and returns? If you want people to use your new language, reduce the cognitive load - do things the same as other languages and be different only where you must. Every time you come up with some completely alien programming construct, you have set a barrier to learning. Coming up with a new language should, for the most part, be an exercise in copying the best of how other extremely popular languages do things, and on top of that build in the necessary differences that make your language special. Also, less is more. For example, one of the reasons Rust is so complex and intimidating is it has six sublanguages https://gist.github.com/brendanzab/d41c3ae485d66c07178749eaeeb9e5f7 https://gist.github.com/brendanzab/d41c3ae485d66c07178749eae... the expression language unsafe runtime language safe runtime language compile time language the type language the trait language the macro language the attribute language Whereas Zig goes the other direction and attempts to make everything programmable in the one core language, even ditching macros entirely. https://ziglang.org/learn/overview/ https://ziglang.org/learn/overview/. In Zig you can write compile time code in the same language and same code base. I put forward these suggestions not as a language edxpert - I am far from it - instead I put them forward as a frustrated learner wanting to do new things and looking at new languages and thinking "shit, I already work with three of four languages plus any number of subtechnologies on a given system, I just don't have time/headspace to learn a programming language with six sub languages".
- cobbal 3y agoThis syntax looks almost exactly like Swift, which is also where it borrows its semantics from.
- turnsout 3y agoYeah, it feels like Swift with lifetimes (which are coming to Swift). Other than the abstract benefits of mutable value semantics for generics, I wonder what would make one reach for Val over Swift (or going the other way, Rust)
- Narishma 3y agoSo now we have V, Val, Vala, Vale. Any other language I'm forgetting?
- jlokier 3y agoVau comes to mind.
- mst 3y agoOnly allowed if it's fexpr based though.
- Buttons840 3y agoIt will work to their advantage. Anyone learning one of these language is looking for "the new hotness", and will probably become aware of the other similarly named languages in the process, and will thus look them up. JavaScript did it, how did that turn out for them?
- hardwaregeek 3y agoI legitimately thought this was Vale. Rather unfortunate collision in naming
- germandiago 3y agoThey are trying to concentrate safe systems programming in permutations of V +{a,l,e}
- samstave 3y agoMay you plz ELI5 'High-level' ? I'm just pointing out that there are several idioms, nomenclatures, slang, blah blah that when stated "high level" is condescending and making it that "i dont need to explain myself to you!!" But yet, you DO have to explain yourself
- deleted 3y ago[deleted]
- zzo38computer 3y agoGood: - It uses "0o" instead of "0" prefix for octal numbers. - Underscores to separate groups of digits in numeric literals. Not good: - It uses Unicode. - It does not have a "goto" command. - There are no macros. - Perhaps, the name is too similarly than the other programming language, maybe? This isn't everything that can be commented about it; I have not examined it completely yet.
- extasia 3y agoI've never liked macros... What attracts you to that feature, I'm curious?
- rcxdude 3y agoin most compiled languages you need something like them to get fully featured metaprogramming. It's not necessarily a case of liking them so much as they often become the best option. (note that C macros are a terrible implementation of macros, and yet despite that and the C++ committee hating them with a passion they are still often the only way to do certain things in C++, because the C++ committee has not sought to make better macros but attempt to extend other language features to accommodate some of their use cases.).
- preseinger 3y agometaprogramming is not a virtue programming languages do not themselves need to be programmable
- cynicalsecurity 3y agoSounds great, but why another language?
- wtetzner 3y agoBecause it works differently than existing languages?
- zamalek 3y agoReally interesting concepts here, especially subscripts (which neatly solve an issue that RAAI semantics or lambdas are usually hacked into solving). Is my reading of overloads correct? Identically-named methods are supported, but only for different argument labels and/or calling conventions? Rust convinced me that dispatching based on argument types is a poor idea, because Vec::new(10) could only be understood by reading the documentation at least once - whereas Vec::with_capacity(10) is abundantly clear. Val seems to gain these benefits (assuming that it doesn't dispatch based on type) without the drawbacks.
- adamwk 3y agoYou're correct; Since argument labels are really part of the function name, you can say all function names must be unique
- germandiago 3y agoWhat about generic code?
- bsaul 3y agoHow come this page reaches top of HN ? Has anything new happened to this language ? I was hoping there was because i liked the idea when it was announced a year ago, but the page doesn’t seem to show anything new.
- sesm 3y agoThis part is exremely confusing: https://tour.val-lang.dev/bindings#lifetime https://tour.val-lang.dev/bindings#lifetime Why a value declared with `let` has a lifetime? Is it because they want to avoid copying objects and data structures?
- zupa-hu 3y agoTo avoid shared mutable state, you either need copy-on-write (hence shared but not mutable) or mutable but not shared. I understand this is the second approach.
- hcarvalhoalves 3y agoDo these terms (“subscript”, “projection”) have a deeper meaning - maybe from another discipline - or are these terms arbitrarily chosen to explain the abstractions of the language?
- fanf2 3y ago“Projection” is often used in functional programming to mean a function that picks a value out of a tuple, e.g. `fst (x,y)` returns x (the first element of the tuple) which is like projecting a vector onto an axis.
- gpderetta 3y agoProjection is also a similar (but more general) operation in relational algebra (i.e. SELECT in SQL).
- ufogigf 3y agoVery straightforwardly: the two terms come from mathematics. "Subscripts are often used to refer to members of a mathematical sequence or set or elements of a vector. For example, in the sequence O = (45, −2, 800), O₃ refers to the third member of sequence O, which is 800." (Wikipedia) As fanf2 said, projection in software typically refers to selecting one element of a tuple. "[Projection is] An operation typified by the jth projection map, written projⱼ, that takes an element x = (x₁, ..., x ⱼ , ..., xₙ) of the Cartesian product X₁ × ⋯ × Xⱼ × ⋯ × Xₙ to the value projⱼ(x) = xⱼ" https://en.wikipedia.org/wiki/Projection_(mathematics) https://en.wikipedia.org/wiki/Projection_(mathematics)
- sanxiyn 3y agoThey are meant to be evocative, but it is best to consider them as arbitrary tokens. There is no close analog in other languages.
- nullc 3y agoCan you really have a systems programming language where the runtime cost is not apparent from the code and stable? Having some code suddenly gain a gigantic copy in an inner loop because of a far away change seems like a risk in val.
- Jenz 3y ago> The result of `longer_of` is a projection of the longer argument, so the mutation of `z` by `emphasize` occurs directly on the value of `y`. The value is neither copied, nor moved, and yet it is not being passed by reference to `emphasize`. The body of `emphasize` owns `z` in exactly the same way as it owns `strength`, which is passed by value: `z` is an independent value that can only be touched by `emphasize`. This evasive phrasing, which continuoes after this excerpt too, has me highly skeptical of their good intentions… Any good reason they are not more explicit?
- sanxiyn 3y agoWhat evasiveness? To me it is very clear what is going on.
- adamhp 3y agoThe human equivalent of "it works on my machine".
- dsgdrfgedrg 3y agoAs someone who has deliberately avoided C++ for the last 20 years (in favour of functional programming) I find the discussions of "reference semantics" and "value semantics" (let alone "mutable value semantics") to be quite opaque. It is as if the C++ community has become an enclave of folks who put up with the extreme complexity of C++ and speak a correspondingly tortuous theoretical language. What the seem to be saying here is that the "subscripting" operation returns a view into its argument, not entirely unlike the concept of a lens. The only thing that view can be used for is directly accessing the the part of the value that is in focus—the view is not itself a first class value, which means that so-called "reference semantics" don't come into the picture. I don't think they're being evasive or promoting their idea in bad faith. They are just operating in a characteristically arcane way for C++ language design people. The following blog post helped me start to grasp what this aspect of C++ talk is actually about: https://akrzemi1.wordpress.com/2012/02/03/value-semantics/ https://akrzemi1.wordpress.com/2012/02/03/value-semantics/
- 3y ago
- yeputons 3y agoI've skimmed through the "mutable value semantics" paper: do I understand correctly that authors suggest replacing references and pointers with either: a) nested structs (with some indirection via `Any` with runtime-checks); b) array indices? The following phrases got my eye: "It is reasonable to ask, then, how we can use mutable value types to represent self-referential data structures, such as doubly linked lists and directed graphs. In fact, any arbitrary graph can be represented as an adjacency list. For example, a vertex set might be represented as an array, each element of which contains an array of outgoing edge destination indices.". I don't see how one can reasonably implement doubly-linked list without re-inventing memory heap and some kind of garbage collection in the implementation. UPD: found some discussion at https://github.com/orgs/val-lang/discussions/736 https://github.com/orgs/val-lang/discussions/736 , seems that there will be some escape hatches akin to Rust's `unsafe`. That resolves all issues, and "whether the safe subset of Val is enough for reasonable application" question is open to long years of debate.
- nine_k 3y agoIndeed, you can reinvent memory by using arrays, and using array indices instead of pointers. It's much less silly than one could think, because these indices are locked to your particular data structure (doubly-linked list, graph, etc) and cannot be manipulated to access anything else in the program, at least not easily. This applies bot to the compiler checking that, and to the attempts to crack the program.
- yeputons 3y ago> these indices are locked to your particular data structure Are they, though? Consider I have a linked list (or a map/dictionary, or any data structure that allows removal of arbitrary elements). I add elements with indices 1, 2, 3, 4, 5. I remove elements with indices 2 and 4. I'd like to make memory consumed by these elements available again. At the same time I don't want to change indexing scheme of the whole data structure. So I have to keep "holes" with indices 2 and 4 at the very least. After few million operations that may become very inefficient. In a typical language, that would be resolved by having a global allocator that allows indices 2 and 4 to be reused in neighboring data structures. If I don't implement a global allocator that shares indices between objects (as that kills the whole point), I consume more memory than needed and rely on my own clunky implementation of garbage collection/defragmentation, don't I?
- KingLancelot 3y ago[dead]
- Tozen 3y agoHow things can go down on HN strikes me as odd, and this seems to be an example. "People" suddenly seem to be quite supportive of: 1) Has not released an alpha yet and after a year. 2) Website that promises a lot (like 2-way C++ interoperability). 3) Clearly telling people it will have trouble supporting the Windows OS. 4) Has relatively limited stars and contributors on GitHub. 5) Wishlists and promises are suddenly fine by them. Then for other languages its media blackout, hate, and an avalanche of trolling. I suppose the hidden machinery and utility accounts don't come out, unless "they" perceive an actual threat to its position. Don't get me wrong, love new languages and seeing more competition. People should follow their dreams. Just weirds me out, as to how reactions and perception goes.
- pertymcpert 3y agoIt seems to be a coin flip. Whichever comment gets upvoted early on continues to be upvoted and becomes the consensus.
- aetimmes 3y agoCommunities aren't monoliths. The groups of people who criticize real tangible languages and people who have the skills to critique the design of abstract language design don't necessarily overlap.
- mbStavola 3y agoPeople were rightfully critical of V for over promising and under delivering as well as misrepresenting the capabilities of the language. Val has promised a lot and hasn't delivered anything, so I think it's fine to be interested/ excited but have a heavy dose of scepticism as well.
- amw-zero 3y agoI'm very happy to see continued investment into mutable value semantics. When I was writing Swift, it felt absolutely magical to have most of the guarantees of functional programming without the performance penalty and intermittent awkwardness. Val just doubles down on the ideas in Swift and goes so far as to remove references altogether. This is a really interesting space.
- wyldfire 3y ago> Val is compiled ahead-of-time to machine code ... to which architecture(s)?
- sanxiyn 3y agoVal is using LLVM.
- sixthDot 3y agoAs a compiler developper (yeah _I'm something of a_ ...) I'm shoked to see - https://github.com/val-lang/val/issues/758 https://github.com/val-lang/val/issues/758 - https://github.com/val-lang/val/issues/711 https://github.com/val-lang/val/issues/711 That smells bad implementation. You should self-host ASAP guys, you'll find more basic bugs like that. Yet 500+ stars !
- verdagon 3y agoAs another compiler developer, there are few mistakes more damaging than self-hosting too soon. A language will be a net benefit for small and medium programs long, long before it's a net benefit for (and has the tooling for) a project as big as a compiler. I'm glad they're not rushing it.
- jamil7 3y agoSwift itself still doesn’t self host and is approaching a version 6 release. I’m not a compiler developer but the outcome of all the discussions around this topic in the Swift community was that it wasn’t worthwhile yet.
- estebank 3y agoBugs like that in a production compiler could be worrying. In a compiler for a language still being defined, not so much. Compare Rust 1.0 vs 1.71 to see how much of a gulf there is between "first stable release" and "compiler of a stable language with lots of real world usage". Self hosting is also not the be-all and end-all. It is a symbolic milestone, more than anything. Achieving it is something to celebrate, but not something to hold against the language until much later on their development cycle, if at all.
- tobinfricke 3y agoNot to be confused with https://en.wikipedia.org/wiki/Vala_(programming_language) https://en.wikipedia.org/wiki/Vala_(programming_language)
- crabmusket 3y agoOr Vale https://vale.dev/ https://vale.dev/
- aslilac 3y agoI've had "playing with val" on the back-burner for a while. Finally tried to today, only to learn that even after 4,000 commits it's still a long shot from usable. Most of the examples from the language tour don't compile, even seemingly simple ones. Carbon has yet to deliver on anything yet, even as Sean Baxter has been making lots of progress on the Circle compiler (including implementing lots of the good bits from Carbon). Hard to be a successor when you can't really be considered a language yet.
- deleted 3y ago[deleted]
- ezekiel68 3y agoFrom the example on their home page: ...no unnecessary allocation occurs. The result of *longer_of* is a projection of the longer argument, so the mutation of z by *emphasize* occurs directly on the value of y. The value is neither copied, nor moved, and yet it is not being passed by reference to emphasize I'm not sure how to read this. A string arg is supplied to a function and a character is (or characters are) appended to it. How can this happen without a new copy of y, since that string must have had an initial lengh (and therefore, a specific place and size on the stack)? Do they create strings with extra padding at the end, just in case someone might append to them? (If so, how much padding and why isn't that generally less efficient overall?) Edit: I didn't realize that asterisk bolding didn't work in quotes. Decided to leave it in anyway.
- pmulard 3y agoThere's more of an explanation further down: To better understand, notice that longer_of is not a function; it’s a subscript. A subscript does not return a value, it projects one, granting the caller temporary read and/or write access to it. I'm not really sure how this doesn't fall under a move? Regarding the string, they could also place it on the heap to allow for the variable sizing, which is what Rust does.
- zupa-hu 3y agoJust because it is an immutable value doesn’t mean it needs to live on the stack. That said, I was wondering about a similar thing: what if I modify a 1GB string? Is it copy-on-write? I feel like it can be optimized away 99% of the time only to leave you with 1% of cases that result in very-hard-to-find performance degradations.
- ezekiel68 3y ago> Just because it is an immutable value doesn’t mean it needs to live on the stack. Right. But the context of the example made me imagine it probably was -- since I would likely reject out-of-hand any new language that always allocated variables on the heap.
- mst 3y ago
- slaymaker1907 3y agoThe thing I haven’t seen yet that makes me raise my eyebrows is sharing one allocation between two data structure. That’s where things get really gnarly with Rust references. The borrow checker is extremely easy to deal with until you start trying to store references in structs, yet the examples I’ve seen with Val don’t show that. Maybe these cases can be simplified, but I’m very skeptical. It’s a fundamentally difficult problem domain considering that these cases are also very difficult to reason about in C/C++. Questions like: will this request last longer than the current thread?
- masklinn 3y agoUnless I got mixed up, from what I remember of previous article it’s because that’s not possible. Val’s references are not first-class, you can’t return or store them.
- 1732050 3y agoFor me I'm interested in the type system provided by a language. For Val, I was a little hesitant when I saw the docs say "Two or more types can form a union type, also known as a sum type." since a union type and a sum type are similar but distinct concepts. For a language, it is very important to understand the differences between these because I think they will greatly impact the design of the language.
- preseinger 3y ago[flagged]
- amedvednikov 3y agoWhy? e.g. Here's DOOM running in V (translated from C). Seems pretty serious: https://www.youtube.com/watch?v=6oXrz3oRoEg https://www.youtube.com/watch?v=6oXrz3oRoEg Also, can you look at this recent 0.4 changelog with 370 items and say the language is not serious? https://vlang.veery.cc/post/725/v-0.4-is-out https://vlang.veery.cc/post/725/v-0.4-is-out
- preseinger 3y ago[flagged]
- amedvednikov 3y agocan you give any examples?
- deleted 3y ago[deleted]
- Tozen 3y agoNonsensical, including telling someone else which languages starting with the letter "V" can't be on their list. As for reading the issues and pull request section, just about all languages have them. So everybody must be "blind", especially younger languages. Which comparatively by age, other languages have more issues and worse close ratios.
- preseinger 3y agothe point isn't that issues and PRs exist, it's that the maintainers don't seem to know what they're doing this is self-evident from a cursory review link me any 3 non-trivial merged PRs and i'm happy to point out the problem i'm describing
- 3y ago
- sedatk 3y agoIn addition to Val and Vale, there is also Vala: https://vala.dev/ https://vala.dev/
- ram_rar 3y agoI often contemplate whether programming language designers consider the developer experience during the design process. Merely perusing the sample code on their web page causes discomfort in my eyes.
- jcparkyn 3y ago> Integer numbers are typically represented by the type Int, which represents a machine-size integer (usually 64 bits on modern computers). I'm not a systems programmer, but I thought there was a consensus these days that this was a Bad Idea™? Are the benefits of marginally better performance on certain platforms really worth having your program break due to an overflow when you run it on a different platform?
- Mathnerd314 3y agoZig has both fixed size types and a native-pointer-sized type. I think it's the right approach, in general you need both.
- asimpletune 3y agoBasic question, but if there are no references and it’s all values all day long, then how do strings, arrays, and other types where the size unknown at compile time work? I saw the example they gave, which is cool, but they were with string literals. So, per my question above, how would the same program work if the strings came from user input?
- superlopuh 3y agoIn my understanding, there are still pointers under the hood, they're just not exposed as such in the type system. If you can't copy a pointer you can't alias, so they're indistinguishable from the value itself in practice.
- ofrzeta 3y ago"Our goals overlap substantially with that of Rust and other commendable efforts, such as Zig or Vale" - oh well, but not with Vala, I guess?
- EspressoGPT 3y agoVal overlaps with Vale but not with V and Vala. :D
- 3cats-in-a-coat 3y agoI love that we see new languages all the time, enabled by reusable toolchains like LLVM etc. but I'm always disappointed how close they are to existing languages. It's understandable why a company like Apple would seek Swift to be familiar to developers, but I don't know why new efforts that will be building a community from scratch would do this. We need more imagination and more bold deviations from the norm, if any of these languages will make sense to pick up for a dev out there.
- zupa-hu 3y agoYou are phrasing it like a universal truth. If this is important to you, do something about it. Otherwise you are just complaining.
- 3cats-in-a-coat 3y agoI'm doing something about it. But I miss an ecosystem of people doing something about it. This variety is required for healthy progress in a field. So people can inspire one another, and lead to significantly new efforts. One instance is nothing, despite of course everyone believes they're making the language that'll take over the world. I often open a new language's site, anticipating innovation and how what I do compares with them. And it's always disappointing to see "it's like X but slightly better" because "X but slightly better" has no chance to overtake an incumbent, and also it shows attitude where we think all there's to discover has been discovered, and it's just tweaks and patches now on, with a new brand label on top. Nothing can be farther from the truth.
- zupa-hu 3y agoBut there are ecosystems of people doing that research into significantly new efforts. I'm thinking of Idris and Agda, for example. > We need more imagination and more bold deviations from the norm This is what I reacted on, a bit too compactly - apologies. Let me unzip. My problem is that this statement 1) feels so far removed from reality, 2) I'm so much interested in this space that this hurts. Why would you recommend others to throw out the good ideas of decades of research just to be hip? Evolution doesn't work that way. Humans didn't evolve by throwing away state-of-the-art apes. Evolution happens by changing one or few bits at a time and iterating while selecting for the good. This means there will be many programming languages that look just like those before them - at least to the untrained eyes. Mutable value semantics is one of the most fascinating ideas in programming. It's like the good parts of functional programming without the bad parts. I'm pretty certain it will revolutionize programming. To dismiss it as being close to existing languages blows my mind. I get that it's hard for any language to take hold without being 10x better. At the same time, it feels naive to build a 10x better language without keeping the good parts of existing languages. Not removing good ideas is as important as adding good ideas. Also, humans are 'stateful', switching costs are real. 10x better not only includes the upsides but also the downsides. Hence, it feels like a sane strategy to not only maximize the upsides of new ideas, but at the same time minimize the downsides of not only removed good ideas but also changes in general, to minimize switching costs.
- Rochus 3y ago> mutable value semantics Isn't this the same effect as we get when using Copy-on-Write, e.g. with the implicitly shared container classes Qt offers?
- amelius 3y agoI'm thinking we need a permissions system for programming languages like we have on smartphones, hear me out. People can't trust every library out there and all of their dependencies. So what I want to do is restrict every library by default, and refine permissions on an as-needed basis. For example, why would a handy library that I grabbed from a random github repo have access to my entire harddrive? Or why would would it need to access the entire internet? Or why would it need to access memory that is owned by another library? For me, this would be an essential part of being a "safe" language. And I bet this is the kind of safety we need more than just memory safety.
- andrewflnr 3y agoCheck out Austral.
- amelius 3y agoCool, thanks!
- MobiusHorizons 3y agoIt seems to me the lack of references would prevent any use in contexts that are talking directly to the hardware (which is typically memory mapped). I’m thinking of microcontrollers or device drivers. You could presumably patch it over with unsafe, but in those contexts that would be the majority of the code, which defeats the purpose imo. I guess they are targeting a different market, but that seems like a big downside for a systems programming language.