Live data from Hacker News

Show HN: Vivaldi programming language

github.com

21–27 of 27 posts

Re: Show HN: Vivaldi programming language

#21
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?

For the parsing aspects, reading about parser generators or the like would be super useful

Re: Show HN: Vivaldi programming language

#22

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 an…

Not at all— any feedback is appreciated :)

I'm beginning to have doubts about String mutability. Fortunately the only actually mutating method at the moment is append, which is redundant with add but for the mutability, so I might just tear that out.

Required parentheses on functions are pretty unfortunate. I'm mainly trying to avoid the situation in Ruby where trying to access functions as first-class objects requires all sorts of weird syntactic overhead. Possibly I could have some kind of prefix operator, so (say) &obj.method would return the function object, and obj.method would call it?

I agree about the ':' 'do/end' ugliness. Originally blocks were delimited by braces, but I think the Ruby-style delimiters look nicer. Frankly I'd prefer to get rid of the ':', but for single-expression functions that looks pretty awful. I could do Haskell-style '=' (Haskell of course being where the 'function-body-is-single-expression' thing came from), but

    fn foo(x) = do
      ...
    end
is also pretty weird-looking; kind of like Scala's function definitions, which I find really abrasive for reasons I can't fully explain.

Binding 'self' is also basically a compromise. Originally it was stored in the method, but that required copying each type's methods (and each parents' methods) into an object on instantiation, which was a pretty much unacceptable performance hit. My thinking is that, whenever you'd want to pass a method 'obj.method', it's equally possible to pass 'fn (x): obj.method(x)'.

I need to rework the 'try...catch' statements in any case; their current semantics are incredibly horrible (it wraps, then immediately calls, the try body in a temporary lambda). Maybe I will just incorporate them into blocks— thanks for the idea!

Re: Show HN: Vivaldi programming language

#23
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?

> What is the problem?

Nobody said anything about it being a some sort of a problem.

Actually, the reason why I checked this link and the comments section is because I thought that this is in some way related to the Vivaldi browser. After reading the comments, I realized that I was completely wrong.

Re: Show HN: Vivaldi programming language

#25
post #21

Earlier quoted context omitted.

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

For the parsing aspects, reading about parser generators or the like would be super useful

I would not recommend using a parser generator tool to build a recognizer por any programming language,unless you design your language to be LL(1) or LL(k) witk a low value of k. Otherwise you are going to suffer a lot with parsing issues.

Parser generators usually have a very limited number of target languages, so you might find yourself stuck into a language you do not want to code in.

Re: Show HN: Vivaldi programming language

#26
post #22

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 an…

Not at all— any feedback is appreciated :) I'm beginning to have doubts about String mutability. Fortunately the only actually mutating method at the moment is append, which is redundant with add but for the mutability, so I might just tear that out. Required parentheses on functions are pretty unfortunate. I'm mainly trying to avoid the situation in Ruby where trying to access functions as first-class objects requir…

> Originally it was stored in the method, but that required copying each type's methods (and each parents' methods) into an object on instantiation, which was a pretty much unacceptable performance hit.

I think more a typical solution is to dynamically bind `self` like you do now on normal method calls. But when a reference to a method is stored, you bind `self` to the original receiver at that point in time.

Basically, you treat it like a closure.

Re: Show HN: Vivaldi programming language

#27
post #25
post #21

Earlier quoted context omitted.

For the parsing aspects, reading about parser generators or the like would be super useful

I would not recommend using a parser generator tool to build a recognizer por any programming language,unless you design your language to be LL(1) or LL(k) witk a low value of k. Otherwise you are going to suffer a lot with parsing issues. Parser generators usually have a very limited number of target languages, so you might find yourself stuck into a language you do not want to code in.

hmm, your results may vary (whitespace-sensitive languages, but that's tricky in pretty much any toolkit), but in my experience most DSLs that people want to write fit well within LL(k). Java works in it, after all.

I started out with Yacc, though, and that helped me out a lot more...

Post reply on HN