Live data from Hacker News

Lily: An interpreted language with a focus on expressiveness and type safety

lily-lang.org

31–40 of 55 posts

Re: Lily: An interpreted language with a focus on expressiveness and type safety

#31
post #9

One of the bullet points is "Abstract data types (with `Option` and `Result` predefined)." I wonder if they mean "Algebraic data type", since I have seen Option/Result before as an example of those, and they're both commonly abbreviated ADTs. Or maybe they're trying to get at a concept I'm missing here?

Yeah, that's a mistake on my part. I pushed a fix just now. Thanks for the tip.

Re: Lily: An interpreted language with a focus on expressiveness and type safety

#32
post #3

Maybe off topic, but I do a lot of ad-hoc python scripts where I drop scripts everywhere in my filesystem, but I need dependencies installed in a virtualenv so my ad-hoc scripts can access them. The problem I'm having is that sometimes things will run for a whole day and then fail at the end because of a typo or something. I've been looking at other languages to see if there's a language like python but type checked,…

Author here. That's roughly what I was shooting for. Python was a big inspiration early on in the design, and later on some functional concepts were put into the mix. I found them and liked them too much to pass up on.

One advantage of Lily not mentioned (with regard to typing), is that the type-checking is very fast. One of the reasons I made Lily interpreted and homebrewed all the parts was because as much as I like static typing, it's often slow. Slow static typing, I think, diminishes some of the value of it since you're still waiting but in a different way.

Re: Lily: An interpreted language with a focus on expressiveness and type safety

#33
post #21

I read the first example of Lily on the site. I found nothing offensive in the language at all - in fact there's a lot to like particularly the readability. Side rant. Unfortunate I can't get past the decision to use exception handling to deal with non-existing keys in map. I'm of the exception-disliking school which is thankfully growing but I guess not yet universal. For me using an exception to indicate the lack o…

Seems particularly weird given that it has "Algebraic data types (with Option and Result predefined)."

Re: Lily: An interpreted language with a focus on expressiveness and type safety

#34
post #3

Maybe off topic, but I do a lot of ad-hoc python scripts where I drop scripts everywhere in my filesystem, but I need dependencies installed in a virtualenv so my ad-hoc scripts can access them. The problem I'm having is that sometimes things will run for a whole day and then fail at the end because of a typo or something. I've been looking at other languages to see if there's a language like python but type checked,…

HN reads as: "Hey everyone, get in here and post your favorite language!"

Re: Lily: An interpreted language with a focus on expressiveness and type safety

#35
post #7
post #3

Maybe off topic, but I do a lot of ad-hoc python scripts where I drop scripts everywhere in my filesystem, but I need dependencies installed in a virtualenv so my ad-hoc scripts can access them. The problem I'm having is that sometimes things will run for a whole day and then fail at the end because of a typo or something. I've been looking at other languages to see if there's a language like python but type checked,…

It was weird for me at first, but actually Rust provides a great solution here. With https://github.com/DanielKeep/cargo-script you can have single file Rust "scripts" with ecosystem dependencies. When executing the file (via the cargo-script wrapper), dependencies are fetched and a binary is compiled on demand (and cached for re-runs). It's pretty awesome for scripts where type safety is important. #!/usr/bin/env ru…

Thanks for sharing that, I had no idea. You just improved my day.

Re: Lily: An interpreted language with a focus on expressiveness and type safety

#36
post #21

I read the first example of Lily on the site. I found nothing offensive in the language at all - in fact there's a lot to like particularly the readability. Side rant. Unfortunate I can't get past the decision to use exception handling to deal with non-existing keys in map. I'm of the exception-disliking school which is thankfully growing but I guess not yet universal. For me using an exception to indicate the lack o…

Rust makes a similar decision, despite having Option and Result.

If you want the Option behavior, there's .get()

Anyways, very cool looking language.

Re: Lily: An interpreted language with a focus on expressiveness and type safety

#37
> Lily uses reference counting for memory management with garbage collection as a fallback.

I'd just call this GC where it's rc + (presumably) a tracing GC.

> .reject(|r| r.is_space() )

This is nice. I've always found "filter" to be a confusing name. Filter in? Filter out?

'reject' is a very clear name - if it is a space, reject it.

Code looks really reasonable.

I find `: {` to be a strange idiom. Why not one or the other? Seems to distinguish between single vs multiline? I guess that's reasonable. A bit noisy.

Re: Lily: An interpreted language with a focus on expressiveness and type safety

#38

> Lily uses reference counting for memory management with garbage collection as a fallback. I'd just call this GC where it's rc + (presumably) a tracing GC. > .reject(|r| r.is_space() ) This is nice. I've always found "filter" to be a confusing name. Filter in? Filter out? 'reject' is a very clear name - if it is a space, reject it. Code looks really reasonable. I find `: {` to be a strange idiom. Why not one or the…

'reject:' is originally from Smalltalk, along with 'collect:' (map), 'select:' (complement of reject), 'detect:' (first matching element), and 'inject:into:' (foldl). I agree that these names are better -- they even rhyme so they're easier to remember!

Re: Lily: An interpreted language with a focus on expressiveness and type safety

#39
post #26

Earlier quoted context omitted.

Well, for good or for bad, python does the same.

To be fair, there's utility to avoid it: check first or do a .get(). That helps you be expressive about what you think should/should not exist

I can definitely see the use in that. In some situations a given key not being present would actually be exceptional.

Re: Lily: An interpreted language with a focus on expressiveness and type safety

#40
post #21

I read the first example of Lily on the site. I found nothing offensive in the language at all - in fact there's a lot to like particularly the readability. Side rant. Unfortunate I can't get past the decision to use exception handling to deal with non-existing keys in map. I'm of the exception-disliking school which is thankfully growing but I guess not yet universal. For me using an exception to indicate the lack o…

Rust makes a similar decision, despite having Option and Result. If you want the Option behavior, there's .get() Anyways, very cool looking language.

But from what I've seen, most idiomatic Rust code doesn't use the `map[key]` syntax, but instead uses `map.get(key)`.
Post reply on HN