Cover image for Bonjour V!

Bonjour V!

pratikgchaudhari profile image Pratik Chaudhari Originally published at Medium ・3 min read

Let's meet the new kid on the programming block.

V is a brand new programming language that's been making quite a few waves in the programming community.

I stumbled upon it a few months back when I read this article.

While V is still in its infancy as of this writing (there are only six questions about it on SO), it is gaining popularity (it has around 15.9K stars on GitHub).

And it's also under active development (as evidenced by the recent commits in its GitHub repo).

So, I thought, why not give it a try. After all, what's the harm in being an early adopter, right?

So, let's get started!

Step 1. Install V on your local machine

You can install V using prebuilt binaries (such as this one), or you can directly compile its source code.

Since I use a MacBook Air (13-inch, 2007) running macOS Catalina (version 10.15.3), I downloaded this prebuilt binary for macOS.

I extracted its contents and fired up the macOS Terminal. Then, I navigated to the directory where I'd extracted the prebuilt binary and fired the following command in the Terminal:

./v version

It's supposed to display V's current version, something like below:

V 0.1.24 0d93eeb

But instead, the following prompt popped up on the screen:

A warning prompt from macOS stating that macOS is unable to verify app (https://support.apple.com/en-us/HT202491)

You see, macOS blocks the execution of apps that haven't been notarized (meaning, apple can't verify the origins of the app, and as a result, can't guarantee that the application isn't malicious).

So, what do we do now? Give up?

Absolutely not!

There's a workaround: We can tell macOS to make an exception for such unnotarized apps by navigating to System Preferences > Security & Privacy and click the "Allow Anyway" button. Take a peek at the gif below to get a better idea:

Now that we've told the bouncer (macOS 😀) to let the guest in, we should be able to start the party, right? (run V via the Terminal without any issue)

But no! 😯 That's not what happens. When we execute the ./v version on the Terminal again, the following screen pops up:

macOS blocks the execution of the app yet again, but this time, there's an "Open" button, which empowers the user to "run" it

This is the same pop-up that we encountered a while back, but this time, macOS has provided us with the "Open" button. Let's click it and see what happens:

V prints its version number on the Terminal

As soon as we click "Open", the ./v version command executes and prints its output on the Terminal.

Step 2. Start writing code in V

Now that V's compiler is up & running on our local machine, we can start writing programs in V.

But wait! Don't we need a fancy IDE like VSCode, with all its elegant themes and plugins 😄 (just joking, it's my favorite IDE.)

No, not yet, at least!

V provides a REPL interface that allows you to play around with the language without having to create any files on your hard disk.

So, as the Hello World Tradition dictates, let's write our first program in V:

print("Bonjour V!")

Press the "enter/return" key on your keyboard and let the magic begin!

The traditional "Hello world" program, or in this case "Bonjour V!" program written using V's REPL interface

Voila! It worked!

That's it, guys!

Stay tuned for more stories about V programming!

Posted on Mar 1 by:

pratikgchaudhari profile

Pratik Chaudhari


Voracious Reader | Polyglot programmer | Full Stack Engineer | Tech Enthusiast | And a slightly opinionated human being :)


markdown guide

I first noticed the profile picture and thought what's Snowdon doing here.
Even if you want to scream to the world that you're a super edhead, you might wanna do that in your bio.