The V Programming Language

@vlang
Simple, fast, safe, compiled language for developing maintainable software.
364 Posts · View blog posts
<Prev 1 ... 4 5 6 7 8 Next>
V now has embedded structs. They work just like in Go:

Which way do you prefer?

V Protocol Buffers library: github.com/emily33901/vproto

In order to make development cycle faster, V uses warnings, not errors, for things like unused variables, unused imports, unnecessary mutables etc.

But since many programmers tend to ignore warnings, V forces to take care of them by turning them into errors in prod builds.

V now has another graphical game example in the main repo: 2048.

github.com/vlang/v/tree/master/examples/2048

You can play the WebAssembly version in your browser:

https://v2048.vercel.app

V has built-in JSON support. JSON serialization is very easy and fast, since it's done at compile time.

The old JSON module used a C dependency: cJSON. Now it's written in pure V, thanks to Ned Palacios.

V has smart casts for sum types and interfaces, like TypeScript and Kotlin.

It makes unwrapping these types very clean:

A good V / V UI performance demo.

Scrolling through 5000 Slack messages in the upcoming Volt client for Slack/Discord:

www.youtube.com/watch?v=V3oss-ECnxw

(public beta for all 3 systems later this month)

Thanks to @helto4real, the V standard library now has a powerful websocket module (x.websocket) that conforms to RFC 6455 and passes the Autobahn test suite (498 client tests and 249 server tests).

V now has an early version of channels. The syntax is the same as in Go:

The V compiler detects typos and suggests the right spelling by looking for existing fields/variables with a similar name:

V now has a clean and easy way to sort all kinds of arrays:

V CI now runs "v fmt -verify" that makes sure all code submitted to the V repository is vfmt'ed.

The V formatter is pretty stable now and ensures clean and predictable code style across all files in the main repository.

V now has early iOS support.

Expect V UI apps running on iOS and Android soon.

Thanks to @develpon, V and the V graphics module now run on Android.

Android will be fully supported soon.

www.youtube.com/watch?v=fIijYm1MfmI

When working with arrays in V, you can specify the capacity of the array during initialization for better performance:

github.com/vlang/v/blob/master/doc/docs.md#arrays

If you want to know what day it is going to be 100 days from now, instead of asking Siri or Alexa, you can simply ask the V REPL:

More than $12k has been donated over the last year to support the development of V. This allowed me to work on V full time.

Thank you very much.

If you'd like to support the project, you can do it via GitHub, and your contribution will be doubled:

github.com/sponsors/medvednikov

The V language is officially out of alpha and now has a backwards compatibility guarantee:

github.com/vlang/v#stability-guarantee-and-future-changes

The V repo now has almost 100k lines of V!

By the way, I really recommend @boyter's scc for counting lines of code. It's an order of magnitude faster than cloc, and it supports V.

The first web app written in V has been open-sourced:

github.com/vlang/gitly

Gitly, a very light and fast alternative to GitHub/GitLab.

- Minimal amount of RAM usage (works great on the cheapest $3.5 instance)
- Easy to deploy (a single <1 MB exe that includes compiled tmpls)

The last missing feature from the old backend is back: V ORM.

- One syntax for all SQL dialects. Easy migration.
- Queries using V's syntax. No need to learn another syntax.
- Safety. All queries are automatically sanitised.
- Compile time checks. No more typos.
- Easy to use.

A minor syntax update: magic `it` variable in sum type/interface matches has been removed. The variable being matched is now cast to the matched type.

`it` didn't work with embedded matches, so it was a bad idea.

Since so many expressed interest in Twitch streams, they will start this month.

You can follow on Twitch:
www.twitch.tv/v_language

Vods will be uploaded to YouTube:
https://www.youtube.com/c/vlang

You can also subscribe to stream notifications via Discord:
https://discord.gg/vlang

A Hello World program built using V's x64 backend is only 182 bytes.

You won't get this even by using NASM.

Would you be interested in daily Twitch streams of developing V and V projects like Gitly, Vid, vweb etc?

The vods would be uploaded to YouTube.

What do you think about a mandatory `!` at the end of a method call to make it clear that the method modifies the receiver?

files.sort!()

`!` can be added by V/vfmt automatically to avoid modifying lots of calls in case the method signature changes.

V's graphics module has just received a major upgrade: now it uses Metal/DirectX/OpenGL instead of OpenGL for everything.

This improved performance and compatibility (Windows has much better DirectX support, Apple deprecated OpenGL).

It also improved text rendering greatly.

V is about readability.

Complex boolean expressions with && and || are very common in programming, and can become confusing.

That's why V requires explicit parentheses to make such expressions clear.

Cross-compiling for Linux and Windows is back.

So now, if you are working on, say, a web app on macOS, you can make a Linux build and deploy a single binary to a Linux server.

Making cross-platform V builds has become much easier:

v -os linux cmd/v
v -os windows cmd/v

Game of life written in V, built with WASM/V.js in your browser:

v-wasm.now.sh/?url:examples/game-of-life.v

Thanks to the V => JS transpiler, V can now run entirely in your browser!

v-wasm.now.sh

The V compiler is compiled to WASM. When you click "run", the V program is translated to JS and evaluated by the browser.

Soon the official playground will be using this.

Is your programming editor in dark mode or light mode?

Awesome V: a curated list of awesome V frameworks, libraries, software and resources.

github.com/vlang/awesome-v

V 0.1.27 is out.

This was supposed to be the 0.2 release, but I forgot about 2 upcoming syntax changes, and I still need to make vweb work with the new backend. It's better to do these before 0.2.

Hot code reloading is one of my favorite V's features.

I've updated the bounce.v demo on the home page.

We change the speed of the objects, their visibility, and color without quitting the program and recompiling it.

The new backend has been successfully integrated. All planned features for 0.2 have been implemented.

The release of the first stable version 0.2 with a promise of compatibility is planned for May 5.

The V project has a "zero unhandled PRs" policy.

I keep the number of unhandled pull requests at 0.

PRs are processed within 24 hours in most cases.

What do you think about renaming the `mut` keyword to `mutable`, like in F#?

I've personally never been a big fan of the word "mut" which sounds like "mutt".

"Mutable" sounds better and adds a bit of extra work to declare mutable variables, which should be avoided if possible

I like removing code.

15k lines of the old backend code were removed in a single commit.

The new backend is now the default.

The new vfmt is 10 times faster!

Mostly because of the new more efficient parser and formatting a single file, not the entire project.

Running vfmt on save will no longer be noticeable.

Also it can now format code that has compilation errors.

Consts: all caps or snake_case?

The new compiler can finally compile itself!

The old backend will now be removed after all tests pass.

After the remaining memory leaks are fixed, V 0.2 will be released.

The new AST based backend is much cleaner, easier to develop/maintain, and ~2 times faster.

Simple V programs no longer have memory leaks. Valgrind tests have been added to CI.

The goal is to improve V's compile time memory management so that the largest V project at the moment, the V compiler itself, is leak free.

A simple calculator in V & V UI:

github.com/vlang/ui/blob/master/examples/calculator.v

V tops Tech Empower's web framework benchmark:

www.techempower.com/benchmarks/#section=test&runid=f9cc9020-a381-4cb0-9614-4fc27c033b5c&hw=ph&test=plaintext

Ulises Jeremias wrote an amazing well documented scientific library in V.

It has physical constants, trigonometric and hyperbolic functions, complex numbers, quaternions, polynomials, numerical differentiation, statistics and easing functions:

github.com/vlang/vsl

Thanks to @leahlundqvist, V UI now has simple animations:

Thanks to @UnnWeihe, V's maps are now hashmaps, not B-trees, with a much better performance of `get()`:

V's new AST based parser is ready.

The development is going to be much faster from now on.

The new tool vdoc is using the new parser. Now you can quickly get module docs by running `v doc [module]`.

HTML docs will be generated and uploaded this week.

<Prev 1 ... 4 5 6 7 8 Next>