7 ms·
The V Programming Language Simple, fast, safe, compiled
- vsskanth 5y agoBeen keeping an eye on vlang since its initial post here (and the subsequent flame war) on HN. The initial language feature list was pretty ambitious. Seems like they're taking a batteries included approach in trying to bring in as many use cases as possible using libraries written in V. How are they progressing towards their promises for vlang in terms of base language features as a systems language ? I remember reading they still had some unsafe stuff going on that needed fixing
- ylluminate 5y agoPretty cool to see Vinix running Doom now: https://www.youtube.com/watch?v=PDzw3M6Qj9Y https://www.youtube.com/watch?v=PDzw3M6Qj9Y
- danielEM 5y agoI'm a bit torn between these as none is suiting all of my needs: http://ecere.org/ http://ecere.org/ https://haxe.org/ https://haxe.org/ https://dlang.org/ https://dlang.org/ and ofc ... https://vlang.io/ https://vlang.io/ All can compile to C and I find it somewhat important as would be very happy to share same code base with microcontrollers (SDCC), Android, Linux, Windows and web wasm. Unfortunately (to my knowledge) not all offer optional or selective garbage collection, some look immature and so on :-(
- moonchild 5y agoD does not compile to c, and has garbage collection.
- adamnemecek 5y agoIt had optional GC.
- danielEM 5y agoLooks like it does, sort of... https://forum.dlang.org/thread/cweufizceawykuglbara@forum.dlang.org https://forum.dlang.org/thread/cweufizceawykuglbara@forum.dl...
- tored 5y agoD has a BetterC mode without garbage collection https://dlang.org/spec/betterc.html https://dlang.org/spec/betterc.html
- fyzix 5y agoSounds like nim is the perfect fit for your usecase. https://nim-lang.org https://nim-lang.org It can also compiles to c, c++, obj-c and js...plus it has an official jetbrains plugin.
- elcritch 5y agoNim works great on microcontrollers. I'm using it with a goal of sharing codebases on embedded and not. It's awesome to be able to write some POSIX network code test it on Linux and get it running on an MCU. The new ARC garbage collector fits the domain well. The non-atomic reference counting makes it predictable and deterministic. Though, it's possible to write Nim without using the GC or turn it off completely.
- danielEM 5y agoNIM looks really amazing, and I mean it. Only thing that stops me from using it is that indentation hell. Can't understand regime enforced on devs to format code in only small number of predefined ways.
- xigoi 5y agoEnforcing a certain format is the best way to avoid bikeshedding and focus on writing code.
- tyingq 5y agoMaybe nim then? Compiles to C and has a sort of optional GC in that you can configure it to do plain reference counting.
- danielEM 5y agoMentioned earlier, NIM looks very mature and I like it in sense of what you can already do with it. Unfortunately indentation based scopes is something that I can't stand in programming language
- Tozen 5y agoPut me also in the group of those not feeling nim. Sad they decided to go the Python route of white space insanity.
- xigoi 5y agoHave you actually worked with an indentation-based language?
- pdimitar 5y agoI did and hated every minute of it. Automatic formatting is fine but if you don't indent while working it can get ambiguous and format your code wrongly. Also it's harder to visually parse. So yes I did and no, your subjective tastes aren't an objective reality. What's your point?
- xigoi 5y ago> if you don't indent while working it can get ambiguous And if you don't write braces in a language that uses braces, it will also get ambiguous. What's your point? > Also it's harder to visually parse. I know that ease of reading is subjective, but I still find it weird that a human finds this: a { b { c; d { e } } f } easier to parse than this: a: b: c d: e f > your subjective tastes aren't an objective reality I'm not the one who used the word "insanity" for the block delimiting system I don't like. > What's your point? You shouldn't disregard a language just for superficial syntax features.
- adamredwoods 5y agoNo optional GC: https://ziglang.org/ https://ziglang.org/
- danielEM 5y agono C backend unfortunately
- sitkack 5y agoAnything that can target Wasm can target C. https://webassembly.github.io/wabt/doc/wasm2c.1.html https://webassembly.github.io/wabt/doc/wasm2c.1.html
- danielEM 5y agoI thought of that solution, but the problem is that when you have 8bit microcontroller and all your operations from webassembly are translated to 32 bit operations then you gonna end up doing 8 bit math on 32 bit emulated math operations aligned back to 8 bit. :(
- sitkack 5y agoYou should see how it works in practice. Not try to discount your goals, but chasing 8 bits is anachronistic, an ESP32-C3 is a single core 160Mhz risc-v chip with 400KB of on chip ram for $1 qty 1. Rust can target AVR directly, https://www.avr-rust.com/ https://www.avr-rust.com/ Wasm runtimes also available for embedded platforms, https://github.com/wasm3/wasm3 https://github.com/wasm3/wasm3
- ylluminate 5y agoPop onto Discord share your problems about V and why you're not seeing it fit your needs: https://discord.gg/vlang https://discord.gg/vlang
- danielEM 5y agoThis is what spooks me out most for now: https://github.com/vlang/v/issues https://github.com/vlang/v/issues It looks like a lot of non trivial issues. Other than that I like the concept of V. Maybe except one small thing ":=" ;-)
- delian66 5y agoV does have an optional garbage collected mode. Just compile your program with: v -gc boehm file.v
- deleted 5y ago[deleted]
- errcorrectcode 5y agoRust had compile to C. It does wasm. No GC. Much safer than most everything except Pony and arguably Idris. Edit: IIRC, there is a wasm2c program that might work.
- TheCipster 5y agoTake a look at Nelua: https://nelua.io https://nelua.io You might like it.
- pjmlp 5y agoD can make use of -DbetterC, -v to track allocations, call GC.disable(), or just place a @nogc on the modules you don't want a GC running.
- adamredwoods 5y agoWow, native (somewhat) GUI already. >> V UI is licensed under GPL3. A commercial license will be available. Open-source projects will have access to the commercial license for free. Every single feature will be open-sourced right away and available under both licenses. At some point in the future the library will be relicensed under MIT. It'd be nice to see a commercial license.
- Tozen 5y agoWould like to add that I do like the V UI. We are talking about a cross platform UI with no dependencies, that was made to integrate from its early stages. This is partly why V is distinguishing itself from the pack.
- Tozen 5y agoYeah, I find the initial choice of license on V UI to be a bit weird. Not understanding the logic behind it, when the main and other parts are MIT, as a GPL UI is a definite way to go down the road of massive headaches, drama, and confusion. GPL can give an unfriendly impression to those they probably could use help or support from. It's still the early stages of the library and the language, so maybe it won't turn into some kind of mess. Possibly, they may have to do some rewrites of existing libraries. Still, it is a curious choice not to at least go LGPL, like many other projects have done who went down that GNU path. Seems like LGPL would have been the right balance to prevent sending mixed or "warning" signals. There is also VIUP (https://github.com/kjlaw89/viup https://github.com/kjlaw89/viup), which is a port of IUP. So, it's not like more adventurous types can't go play with that. That's under the friendlier MIT license.
- smackeyacky 5y agoWhat is the cross platform GUI like? Its amazing to me these guys have one but .NET doesn't. Maybe I can wrap my .NET libraries in V?
- Tozen 5y agoI'm a bit impressed by vlang, despite some earlier controversy from years ago. Of all the new languages, I have been keeping track of this one the most. They have also been maintaining a strong development pace. Something else that I like that many don't know or notice is their connection to Oberon (a kind of successor language to Pascal). It's a nice merge between various ideas and useful qualities among Pascal/Oberon, C, and Go.
- pjmlp 5y agoHaving used Native Oberon, and followed up on most of its derived languages, I fail to see the relation with Oberon in any of those languages. Go being the exception as it uses Oberon-2 method syntax, an unsafe package similar to SYSTEM, and Robert Griesemer designed Oberon-V for his PhD.
- Tozen 5y agoI'm referring to a more superficial and subtle influence, and V also has other influences (like C) and Go, but if you are working with it then you will notice them. Some are: 1) Uses modules 2) Declarations made at the top (no headers, so more like the Pascal family) 3) Types are indicated after, not before like in the Pascal family as oppose to C (fn foo(a int, b string)). 4) ":=" uses the walrus (visitor := ['Tom', 'Jake', 'Harry']) 5) Use of .. for subrange, etc... It's debatably enough for those that know Oberon/Pascal to feel more comfortable. You can see the purposeful blending of various qualities of the languages.
- SakanOMan 5y agoTwo more weeks, the language.
- eggy 5y agoI have been playing with it, and it is fine. I run into particular issues with some things, but they are usually easy to figure out or seek help on. I do like the syntax and installing packages, e.g.: v install ui
- quantum_state 5y agoIs there a version of the language spec of this? It seems to me that to ensure continued evolution and development of the language, it would be good to get some of the basics set up ..