Live data from Hacker News

Show HN: Vivaldi programming language

github.com

11–20 of 27 posts

Re: Show HN: Vivaldi programming language

#11
post #6

There is another project called Vivaldi, a new web browser. It's been featured on HN a few times. https://vivaldi.com/

Dang it! I googled and everything. No slight against them intended; it looks like a really cool browser, and certainly more of a Real Project than my little language! Hopefully the domains are different enough that the overlap isn't too egregious, but if not there are plenty of other Baroque composers I could switch to.

Re: Show HN: Vivaldi programming language

#12
post #2

So this[1] post recently made its way across the HN front page, which I found serendipitous given my current side project. There's nothing terribly groundbreaking in my language— everything in it is basically taken from Ruby, Scheme, or Python— but I certainly learned a lot making it, and maybe some of y'all will find something of interest in it. [1] https://news.ycombinator.com/item?id=9040029

Got any recommendations for resources to get started creating one's own language?

Re: Show HN: Vivaldi programming language

#13
Is there any build/install instructions? Want to play around :)

EDIT:

  git clone git@github.com:jeorgun/Vivaldi.git
  cd Vivaldi
  # if you don't have boost then run 
  brew install boost
  mkdir build
  cd build
  cmake .. && make # cmake version 3 or greater is required

Re: Show HN: Vivaldi programming language

#14
post #13

Is there any build/install instructions? Want to play around :) EDIT: git clone git@github.com:jeorgun/Vivaldi.git cd Vivaldi # if you don't have boost then run brew install boost mkdir build cd build cmake .. && make # cmake version 3 or greater is required

Oh, whoops— sorry about that! I added some instructions based on yours to the README; better?

Also, if you run in to any issues, feel free to let me know; I only have my MBP and an old Thinkpad T60 running Arch Linux to test on, so I could very well have unwittingly done something non-portable (I'm assuming that Windows support is a complete no-op, but I'd be happy to hear I'm wrong).

Re: Show HN: Vivaldi programming language

#15
post #2

So this[1] post recently made its way across the HN front page, which I found serendipitous given my current side project. There's nothing terribly groundbreaking in my language— everything in it is basically taken from Ruby, Scheme, or Python— but I certainly learned a lot making it, and maybe some of y'all will find something of interest in it. [1] https://news.ycombinator.com/item?id=9040029

Got any recommendations for resources to get started creating one's own language?

Pat Shaughnessy's Ruby Under a Microscope[1] is a fantastic resource for looking at Ruby's internals, especially concerning parsing, Ruby's class structure, and the YARV virtual machine.

It's probably easiest to begin with a Lisp dialect, since a basic one needs only two data types (singly-linked lists and symbols) and its eval function is so simple. Peter Norvig has a great tutorial[2] on implementing a Lisp in Python.

Beyond that, it can be helpful to look at the source code for other languages similar to what you're looking to create, to get a sense of how they do things.

That's more or less what I found helpful, in any case. Good luck!

[1] http://patshaughnessy.net/ruby-under-a-microscope [2] http://norvig.com/lispy.html

Re: Show HN: Vivaldi programming language

#16
post #6

There is another project called Vivaldi, a new web browser. It's been featured on HN a few times. https://vivaldi.com/

Well, Apple stole 'Swift' from a different language (was quickly changed to "parallel scripting language"):

http://en.wikipedia.org/wiki/Swift_(parallel_scripting_langu...

He created something in an entirely different category. Both projects have similar chances to succeed. What is the problem?

Re: Show HN: Vivaldi programming language

#17
I really wish Ruby had some kind of `var` or `let` syntax so it was a bit easier to determine when one was calling the method "foo=" or when one was assigning the local var "foo" to something. Having this would reduce the amount of `self`s in the code for class definitions.

Re: Show HN: Vivaldi programming language

#18
post #6

There is another project called Vivaldi, a new web browser. It's been featured on HN a few times. https://vivaldi.com/

Well, Apple stole 'Swift' from a different language (was quickly changed to "parallel scripting language"): http://en.wikipedia.org/wiki/Swift_(parallel_scripting_langu... He created something in an entirely different category. Both projects have similar chances to succeed. What is the problem?

People just like sharing that kind of thing. When I made this little page http://chrisdone.com/z because I couldn't be bothered thinking of a better name, there were dozens of people commenting and emailing me expressing concern that there is already a Z programming language and I should respect other authors etc.

Re: Show HN: Vivaldi programming language

#19

I really wish Ruby had some kind of `var` or `let` syntax so it was a bit easier to determine when one was calling the method "foo=" or when one was assigning the local var "foo" to something. Having this would reduce the amount of `self`s in the code for class definitions.

Oh, that is evil.

Re: Show HN: Vivaldi programming language

#20
This looks really cool! Some random feedback. It's your baby, so feel free to ignore any and all of this you don't agree with.

First off, you did two things right that a lot of hobbyists (including myself, multiple times) do wrong right out of the gate:

1. You wrote some nice, readable introductory docs.

2. You didn't make the language syntactically weird for no good reasons. I can instantly read your code samples and understand them. Yay!

---

There's a good chance you'll end up regretting making strings mutable. It means APIs that receive and store a string have to either copy the parameter (slow, easy to forget) or run the risk of having something that they would be unchanging change under them.

This is a problem with mutability in general, but I think strings hit the pain point most strongly since they're immutable in other languages.

---

You have lots of methods that don't take arguments (size(), start(), end(), etc.). Some kind of getter syntax would be nice to lose the pointless "()".

---

I like your range syntax. I'm using ".." and "..." (like Ruby) in a hobby language of mine[1], and it's definitely not intuitive to many users.

[1]: https://github.com/munificent/wren

---

Your mixture of ":" for functions and control flow but "do ... end" for blocks hurts my soul in some hard to define way. There's nothing intrinsically wrong with it, but I see ":" and expect Python-style indentation then see "end" and get all confused.

It might be nice to try to pick one or the other -- use indentation for blocks, or "end" for functions and control flow.

---

I think you may eventually find the way "self" is dynamically bound to be an annoying frustration. What you have is semantically simple and follows JS and Lua.

But it trips people up when people want to do things like store a reference to a method in a callback and invoke it later. When that helps, you'll have forgotten the old "self" reference.

Of course, solving this is also fairly complex. It usually requires some kind of explicit function/method distinction (makes the language more complex) or an explicit way to close over "self" (easy for the user to forget).

---

"All variables must be declared before use:"

Damn straight. Implicitly declaration gives me hives. :)

---

I like your cond statement, though I've never personally dug the name "cond". The semantics are neat, though.

---

You could get rid of "try" and just allow any block to have a catch clause. That's what Ruby does, and I've always found it elegant.

Post reply on HN