News for hackers. Stuff that matters.
Re:V Programming Language by andr on Friday March 15, 2019 @04:17PM (#19403840)
I love looking at new languages. People invent really creative stuff. However, my exploration usually ends with "this is great, but there are no libraries for it, so I probably won't use it".

If you are building a language, starting from scratch is the epitome of Not Invented Here syndrome. Build it on top of an existing ecosystem. Look at Elixir and how it builds on Erlang and interoperates with it just perfectly. Or look Groovy, Scala and Clojure to see what kind of range you can get from a single platform. With the exception of Go, every language that has become popular in the past 10 years, built on something else.

Re:V Programming Language by mstade on Friday March 15, 2019 @06:45PM (#19405010)
> With the exception of Go, every language that has become popular in the past 10 years, built on something else.

And Go probably wouldn't have half the range it enjoys today without the massive reach and coffers of Google. That's not a snark, or a critique even, just a reflection of the difficulty of breaking through in this space and indeed a comment to support your assertion that in order to succeed in this space today you probably have to build on or successfully interoperate with an already established platform.

If Go didn't have the backing of Google, I doubt it'd have half the audience it enjoys today; Rob Pike notwithstanding. Case in point: Plan 9.

Re:V Programming Language by login102939 on Saturday March 16, 2019 @12:41AM (#19406382)
Not everyone is motivated by success. Grigori Perelman?

IMO people interested in success should be suspect. It’s weird to me that people would go through life seeking attention for invention that will not last much beyond their death.

If anyone here believes their efforts at even a Google size company are forever: 80% of the companies listed as Fortune 500 firms do not exist anymore.

Other than a few key discoveries, for a variety of reasons, none of the work at those firms is considered of value.

Re:V Programming Language by coldtea on Saturday March 16, 2019 @09:17AM (#19407666)
>IMO people interested in success should be suspect. It’s weird to me that people would go through life seeking attention for invention that will not last much beyond their death.

Err, the attention and success can help them get money, funding for their projects, and other niceties much before their death, so there's that.

Re:V Programming Language by TheTrotters on Sunday March 17, 2019 @02:43AM (#19412583)
> Not everyone is motivated by success. Grigori Perelman?

I don't see how he wasn't motivated by success. He wasn't solving recreational math puzzles.

True, his definition of success didn't include money or prestigious prizes. Still, proving a great and long-standing theorem is a way greater accomplishment than becoming a millionaire.

Re:V Programming Language by pushpop on Friday March 15, 2019 @07:54PM (#19405431)
Plan 9 is a little different because it's harder to flitter between operating systems than it is programming languages.

That said, I'm not discounting what you're saying about Go's popularity either.

Re:V Programming Language by mstade on Friday March 15, 2019 @08:21PM (#19405544)
My point with mentioning Plan 9 was that even with luminaries such as Rob Pike, success is not guaranteed. Having a huge organization backing you doesn’t hurt. (Ok, granted, plan 9 had bell labs but I posit a research arm is altogether different from the commercial entity that is google.)
Re:V Programming Language by rakoo on Saturday March 16, 2019 @08:53AM (#19407564)
It's interesting you bring Plan 9 up, because it was closed source for a long time, who knows if it was long enough to kill interest. Probably another factor for success.
Re:V Programming Language by pushpop on Saturday March 16, 2019 @11:39AM (#19408338)
I got that. I was saying there were a lot of other mitigating circumstances that contributed towards Plan 9’s lack of success that would be specific to Plan 9 and thus not relevant to general purpose programming languages. So it’s not really a great example.

I do think your general point does have merit and the computer industry is littered with examples of great languages that have either failed to gain traction or just fallen out of favour for whatever reason.

Re:V Programming Language by c256 on Friday March 15, 2019 @09:05PM (#19405747)
I think what the OP meant was “cases in point: Alef & Limbo”. (These were languages that were introduced with Plan 9 and its successor Inferno, that didn’t catch on.)
Re:V Programming Language by c8g on Saturday March 16, 2019 @06:17AM (#19407148)
point: utf8 (unicode)
Re:V Programming Language by _hardwaregeek on Friday March 15, 2019 @07:11PM (#19405197)
Except that's your specific attitude towards language adoption. And while it's a perfectly reasonable stance, there's plenty of people who see a language with no libraries and see an opportunity to build their own. Every language ecosystem has to start somewhere.

Also, Rust started in the last 10 years and wasn't built on anything. Unless you count LLVM?

Re:V Programming Language by bunderbunder on Friday March 15, 2019 @07:25PM (#19405283)
One of the main things that attracts me to non-mainstream languages is that they offer a chance to build some of the kinds of things I like to build for fun, without a bunch of killjoys nagging me about how $language already has $library.

Granted, there are still killjoys who want to nag about how $language isn't on the TIOBE index, but they're usually easier to ignore.

Re:V Programming Language by bunderbunder on Friday March 15, 2019 @07:06PM (#19405168)
It looks like V is built on top of the biggest ecosystem of them all: C.

From the page comparing to other languages, they claim "Zero cost C interop".

Re:V Programming Language by bartl on Friday March 15, 2019 @09:55PM (#19405912)
Yet I've skimmed the entire site and nowhere do I see mentioned how to use C libraries in V.

I don't have to convert C to V and then compile the entire V program, do I?

Re:V Programming Language by bunderbunder on Friday March 15, 2019 @10:14PM (#19405984)
I doubt it, but it's hard to tell. More will become clear once they've actually released the langauge - as it is, this whole website seems super premature, since neither the language itself nor the source code to any real software written in it are available for public consumption.

The documentation that exists is minimalist enough that I would be very careful about assuming it represents a complete representation of the language's features.

Re:V Programming Language by amedvednikov on Saturday March 16, 2019 @01:44AM (#19406535)
Good point, I'll add an example.

It's just `C.puts('hello')`

Re:V Programming Language by edflsafoiewq on Saturday March 16, 2019 @06:49AM (#19407214)
How do you include the header with puts though?
Re:V Programming Language by amedvednikov on Saturday March 16, 2019 @07:02AM (#19407245)
#include <stdlib.h>

fn main() { C.puts('hello') }

Re:V Programming Language by ncmncm on Monday March 18, 2019 @10:37AM (#19421370)
This is an important point.

amedvednikov is the author.

It is hard to interpret it. The V compiler parses C?

Re:V Programming Language by TheAceOfHearts on Friday March 15, 2019 @08:09PM (#19405491)
TypeScript is a good example of a language that received widespread adoption due to its ease of integration with regular JavaScript.

Another lesser-known example is ReasonML [0], which is supposed to integrate really well with JavaScript and OCaml. Based on my experience, it's still young with plenty of rough edges but it's very promising.

[0] https://reasonml.github.io/

Re:V Programming Language by dan-robertson on Friday March 15, 2019 @07:53PM (#19405429)
To offer a counterpoint, I basically entirely disagree with your opinion but maybe we have different ideas of using something.

Most libraries aren’t really that useful in the long term (although the most-used are). Typically they will not do quite what you want or they will do more than you need and therefore what you want will be mixed up with a lot of other things you need to specify. In cases where a perfect library already exists for your thing there is a reasonable chance that your thing already exists, and otherwise just use whatever language the library is in.

Now there are some libraries but I claim that basically everything else you can get away without and just do it yourself only adding things as you need them. E.g:

libc type library is quite fundamental. Likely a lot of the basic stuff already exists. So long as you have an ok ffi it should be easy to add any missing calls.

HTTP client. This is likely to exist but also not super hard to implement. One can also skip this and ffi/shell out to curl.

Json parser. Again likely to exist and quite easy to implement.

Data structures. Likely to somewhat exist although anything missing that you want may be a bit annoying to add. Typically I think most projects don’t hinge on exactly the right exotic data structure, and if they do then they should be implementing that themselves.

E.g. yaml parser. Less likely to exist and annoying to implement but you can just use some existing program to convert to json first and then easy.

E.g. bindings for your favourite C drawing library. Probably don’t exist but hopefully there is an ffi so just do it yourself.

Libraries aren’t really very special and rolling one’s own isn’t hard. And even if you refuse that, you can just write part of your project as a simple unix process and call that from your python script with all the libraries you want.

Personally I see the lack of libraries as an opportunity to not search around for libraries or try to work out how they can go wrong or be forced to do things a certain way. Especially if the language is novel, it probably isn’t really clear how such a library should be structured. E.g. the reason that rust doesn’t have a canonical gui library isn’t that there are no libraries or no one is trying or no libraries exist but rather that the community in general are still trying out different approaches trying to find something that fits the language well. On the other hand the OP mentions the existence of a widget library for V already.

Re:V Programming Language by hderms on Friday March 15, 2019 @08:49PM (#19405675)
Http clients and Json parsers aren't great examples because both should be about as fast as you can make them. Idk about you but I don't find it credible to claim writing your own http library or Json parser is a reasonable route to go down in most cases. Not to mention the opportunity cost of reinventing those wheels would be quite large.
Re:V Programming Language by rakoo on Saturday March 16, 2019 @08:56AM (#19407577)
Especially considering HTTP 2 is an entirely different beast, which means it's more or less another library.
Re:V Programming Language by coldtea on Saturday March 16, 2019 @09:19AM (#19407677)
Well, those kind of types can always stick to the popular and safe languages...
Re:V Programming Language by ncmncm on Monday March 18, 2019 @11:28AM (#19421865)
The importance of libraries turns largely on how powerful the language is. For a weak language like Java or C, it takes a lot of library to be much help.

A more powerful language like C++, Rust, or Haskell can capture much more semantics in a library. This builds on itself, so that spending time optimizing a library is worthwhile if the library starts out more useful. Putting more work into a library benefits every user if the library can absorb the extra work.

Obligate-GC cuts library authors off at the knees, so otherwise powerful GC languages tend not to collect libraries.

Re:V Programming Language by staticassertion on Friday March 15, 2019 @10:20PM (#19406004)
It's interesting that you chose Elixir, Groovy, Scala, and Clojure as examplars - they seem like failures from an adoption standpoint.

Go, your exception, is by far the most successful of the languages listed.

Re:V Programming Language by tormeh on Saturday March 16, 2019 @12:25AM (#19406345)
That's not true. According to the Redmonk rankings, Scala is slightly more popular (based on GitHub and Stack Overflow) than Go. They are both solidly tier 2 languages. Groovy and Clojure are tier 3 languages. Elixir is about as popular as Fortran or Ocaml, which is not bad, but kinda niche.
Re:V Programming Language by staticassertion on Saturday March 16, 2019 @12:38AM (#19406375)
That lacks the context of their age.

Go is 10 years old, scala is 16 - 60% older, and it was built on top of the JVM, which is much older than that.

I feel like that's worth mentioning, because it seems like Go has more momentum - maybe there's data that shows otherwise though, like trends in Redmonk over time. I had a quick look and didn't see an easy way to get that. I'd be happy to be proven wrong, it's just the impression I get.

Re:V Programming Language by coldtea on Friday March 15, 2019 @05:04PM (#19404278)
>If you are building a language, starting from scratch is the epitome of Not Invented Here syndrome.

And there's nothing wrong with that.

Re:V Programming Language by AnimalMuppet on Friday March 15, 2019 @05:41PM (#19404584)
Depends on whether you want the language to be used.
Re:V Programming Language by coldtea on Saturday March 16, 2019 @09:01AM (#19407596)
I've never seen a language being used or not used because it reused some other ecosystem.

It might have worked for Clojure and Scala, but didn't get tons of other JVM targeting languages very far.

And inversely, C, C++, Java, Python, Perl, Go, Rust etc succeeded by themselves.

Re:V Programming Language by mahmoudimus on Saturday March 16, 2019 @12:40PM (#19408681)
I would argue that Kotlin (https://kotlinlang.org) is an exception to this rule.

It’s extremely popular and I could foresee it eclipsing new Java projects going forward.

Re:V Programming Language by vorg on Saturday March 16, 2019 @05:23PM (#19410374)
Kotlin hit the sweet spot between the abtrusity of Scala and the sloppiness of Apache Groovy.
Re:V Programming Language by AnimalMuppet on Saturday March 16, 2019 @01:45PM (#19409073)
Re-used an ecosystem? Perhaps not. But the breadth of the library is a big deal for language usability. The easy way to get a big library is to steal an existing one.

Java and Go didn't take that route, because they had corporations behind them that could put a lot of people on writing a solid, broad library fairly quickly. When C came out, the standards were a lot lower - a few people wrote the library that they wanted. Same with Perl. (CPAN is an amazing organic achievement, but it took time to develop.) When C++ started, it just used C's library. I don't know about Python.

Rust is the exception to my reading of this, but even Rust had a large organization, even if it wasn't a corporation. So I think the rules are be early, so standards are lower; have a big organization write a big library at the beginning; or use an existing library to get off the ground.

Re:V Programming Language by coldtea on Saturday March 16, 2019 @04:14PM (#19409982)
>* The easy way to get a big library is to steal an existing one.*

Doesn't that always lead to compromises in the language design (to easily link to the old language) and sub-par non-idiomatic libraries?

Re:V Programming Language by AnimalMuppet on Sunday March 17, 2019 @05:57PM (#19416931)
Probably at least to some degree, yes.

But there are different degrees. C++ had "extern C", which is not much. Java, get the same ability, had JNI, which is gouge-your-eyeballs-out ugly.

A language can probably survive having something like "extern C" to be able to get to the libraries. But if JNI were the way to get to the standard library, it probably would have killed Java.

Re:V Programming Language by fogleman on Friday March 15, 2019 @05:07PM (#19404302)
And Go put a lot of effort into the standard library by the looks of it.
Re:V Programming Language by yiyus on Friday March 15, 2019 @07:01PM (#19405135)
The initial library was very based on Plan 9 and Inferno libraries. It was far of being a direct port (not even a derived work strictly speaking), but it certainly took a lot of inspiration.
Re:V Programming Language by andrenth on Friday March 15, 2019 @05:28PM (#19404496)
Would love a modern programming language that compiles to Go and can call Go libraries...
Re:V Programming Language by fouc on Friday March 15, 2019 @07:02PM (#19405143)
That would be a sign of maturity in the Go ecosystem if a whole new language could be built on top of it - perhaps one that isn't C-like/Go-like at all.
Re:V Programming Language by amedvednikov on Saturday March 16, 2019 @01:46AM (#19406538)
The very first and ancient version of V was compiling to Go :)

I think this can be an option in the future. The language is simple enough.

Re:V Programming Language by Koshkin on Friday March 15, 2019 @06:21PM (#19404864)
All I know is that such language would first be called “Go with classes,” then “Go++.”
Re:V Programming Language by wellsjohnston on Friday March 15, 2019 @09:51PM (#19405897)
I started a project called Go++ which was exactly this lol
Re:V Programming Language by int_19h on Friday March 15, 2019 @08:56PM (#19405701)
*Go with templates
Re:V Programming Language by azhenley on Friday March 15, 2019 @07:49PM (#19405414)
I’ve been working on a language that builds on top of Go for this exact reason. I want to use the existing ecosystem.

But a lot of people have been telling me it isn’t a “real” language and that I need to target either C or LLVM. Can’t please everyone, I suppose.

Re:V Programming Language by mrath on Friday March 15, 2019 @11:41PM (#19406244)
I think that is a great idea. something like typescript? Do you have a repo you can share?
Re:V Programming Language by stevekemp on Saturday March 16, 2019 @09:08AM (#19407626)
I find the same, but there are rare gems out there.

Frustratingly I saw a fun-looking language posted here before, which was a virtual-machine based system. It was small, clear, and had a good range of libraries and I'm damned if I can find it again!

Re:V Programming Language by Solarsail on Sunday March 17, 2019 @01:43AM (#19412428)
http://wren.io/ Has been around HN before, as has https://fascinatedbox.github.io/lily/

Were either of these two the ones you were thinking of?

Re:V Programming Language by stevekemp on Wednesday March 20, 2019 @04:38AM (#19440119)
wren was the project i Was thinking of, thank you so much for the help!
Re:V Programming Language by rkeene2 on Saturday March 16, 2019 @10:14AM (#19407888)
Probably Tcl ;-)
Re:V Programming Language by dunefox on Saturday March 16, 2019 @12:14PM (#19408514)
Pharo, Pixie, Pony, ...?
Re:V Programming Language by stevekemp on Saturday March 16, 2019 @01:03PM (#19408815)
I looked those up:

https://pharo.org/ - A language with an IDE

http://pixielang.org/ - A lisp.

https://www.ponylang.io/

Sadly not a match. All I remember was that the language was written in C, compiled to bytecode and was executed in a virtual machine (like Lua, and similar languages). It was "small" and "fast" and probably had a C-like syntax.

I should perform a decent search, because the more I think about it the more I'm annoyed now!

Re:V Programming Language by lorenzk on Saturday March 16, 2019 @02:54PM (#19409479)
No virtual machine, but maybe you‘re thinking about https://nim-lang.org ?
Re:V Programming Language by stevekemp on Saturday March 16, 2019 @04:23PM (#19410047)
No, it was definitely bytecode/vm-based. That was one of the reasons I was interested - because I've written a couple of toy virtual machines myself.

I should just post an "Ask HN: Tell me of your niche languages" and hope I get lucky!

Re:V Programming Language by masukomi on Saturday March 16, 2019 @05:39PM (#19410453)
Pharo is a Smalltalk distribution. I believe it's based on Squeak.
Re:V Programming Language by tombert on Friday March 15, 2019 @05:03PM (#19404272)
This compiles to C, which (I think) means it should be able to FFI to it fairly easily?
Re:V Programming Language by amedvednikov on Friday March 15, 2019 @05:55PM (#19404680)
Yes, calling C functions is as simple as C.puts('hello world')
Re:V Programming Language by tombert on Friday March 15, 2019 @06:16PM (#19404827)
Ah, cool, so effectively the standard library is huge :).

Question though; I'm assuming that if you're touching C, there's no extra protection added by V, right? The C will be just as unsafe as it was before, or do you add some kind of exception handling thing around it?

Re:V Programming Language by amedvednikov on Saturday March 16, 2019 @01:49AM (#19406541)
No extra protection right now. You have to handle error codes.

Strings are simple: 'hello'.cstr()

So are arrays: [1,2,3].carray()

But if you work with pointers, you have to be careful. Maybe I'll implement an unsafe block.

Re:V Programming Language by hexane360 on Sunday March 17, 2019 @10:44AM (#19414261)
How can this be true if "V's memory management is similar to Rust but much easier to use"?
Re:V Programming Language by megous on Friday March 15, 2019 @08:13PM (#19405513)
Where did you get an idea that the language has exceptions?

Looks like they just have a way to return errors if you use question mark at the end of function declaration. See "Option types" here https://vlang.io/docs

Re:V Programming Language by tombert on Friday March 15, 2019 @08:43PM (#19405650)
Sorry, that's kind of what I meant, though I realize I made a mistake in how I said it.
Re:V Programming Language by slavapestov on Saturday March 16, 2019 @01:19AM (#19406469)
Why should the goal of every programming language be to become popular?
Re:V Programming Language by robbrit on Friday March 15, 2019 @06:45PM (#19405017)
Seems like you either need to build off an existing platform, or have a company bankroll it. Rust also falls into this category.