Live data from Hacker News

Motivation – Keli Language

keli-language.gitbook.io

211–220 of 300 posts

Re: Motivation – Keli Language

#211
post #191

On the topic of language IDE support. One of the things I've noticed from working in a few languages professionally (Python, Ruby, Java, Elixir) is that the level of power required in an IDE seems to be a function of the language. My observation was that to feel comfortable in Java I tended to require a very powerful IDE (Intellej) to deal with refactoring and appeasing the type system. When I write Elixir, I feel co…

This is true, especially when it comes to array languages. When I was learning kdb+/q, I realized that the language was small enough that I didn't need autocomplete. Also, the language is so powerful that I didn't really even type that much. I would have been perfectly happy writing out the code on a paper napkin it was so terse.

My observation is that I tend to like languages that I don't need powerful tools to work with. That seems to be a mark of a well designed language to me

Re: Motivation – Keli Language

#212

Earlier quoted context omitted.

Should I look for the function called: `getStudentByClassRoomFirstNameLastName` or is it `getStudentByClassRoomLastNameFirstName`, or `getStudentByClassRoomFullName` since you sort that way. They you have to deal with optional parameters, do you have an extra argument for that or is there a `getStudentByClassRoomFirstNameLastNameMiddleName` function out there? Now you are scanning the auto-complete code trying to fig…

Even better is Elixir's Ecto or Linq Students |> Students.Repo.get_by(first_name: "Ryan") from s in Students where firstName = "X" select s Students.AsEnumerable().Select(s => s).Where(s => s.Name == "X") etc.

Elixir is what I was thinking of for much of the above, unfortunately, I only used it fairly briefly and so I was going largely on memory and some of that is likely more Swift than Elixir which shares some of that.

I really loved using Elixir, very frustrating going back to TypeScript after that.

Re: Motivation – Keli Language

#213

I personally don’t think keli is fixing the right problems: I’m personally an ocaml user, and I don’t see what keli adds to ocaml. They cite positional parameters (that they call "prefix notation"… i wonder why ?) but ocaml already has support for named parameters (you can write things like split ~on:"," "a, b, c" for example) Moreover, guessing the order of parameters is generally not that hard : — If you have good…

There is https://github.com/avsm/opam-tools which aims to simplify the process of setting up a local opam project with all the tooling required.

On the topic of and janestreet-core/base and named parameters, I don't like how it basically forces you to name your arguments whenever you need to compose functions. I much prefer Containers library which is lighter and stdlib friendly.

* Base/Core: List.range 0 20 |> List.map ~f:(fun x -> x * 2) |> (fun l -> List.take l 5)

* Containers: List.range 0 20 |> List.map (fun x -> x * 2) |> List.take 5

Re: Motivation – Keli Language

#214
post #136

Earlier quoted context omitted.

I'd prefer readability to suffer because the fold over a monad needs something clever that requires a bit of reasoning to understand than because vast amounts of "readable" boilerplate (for example, trivial getters and setters) hide a needle in a haystack.

folding over a monad (or any other combinator) doesn't require extra reasoning or anything clever, that's the point.

It does if you are unfamiliar to the pattern. It probably has more to do with experience with the patterns used rather than readability.

Re: Motivation – Keli Language

#215
post #195
post #12

Earlier quoted context omitted.

Exactly what I came here to write about: Python 3.8.2 (default, Jul 16 2020, 14:00:26) >>> " ".join(["a", "b"]) 'a b' vs Ruby 2.6.5 :001 > ["a", "b"].join(" ") => "a b" I don't know which one is more natural but I prefer the Ruby version because it's consistent with "a b".split(" ") which works in both languages. One less think to remember.

the key difference is that in ruby, `join` is implemented in the `Enumerable` mixin (which provides a whole suite of functionality to any object with an `each` method). if your own class wants to support `join`, it has to both implement `each` and explicitly mix in `Enumerable`. in python, `join` is implemented in the `string` class, and the argument is an iterable. therefore, if your class wants to support `join`, i…

Actually join is a method of Array https://ruby-doc.org/core-2.6.5/Array.html

A class that wants to support join has to implement to_s. The definition of join is

> join(separator=$,) → str

> Returns a string created by converting each element of the array to a string, separated by the given separator. If the separator is nil, it uses current $,. If both the separator and $, are nil, it uses an empty string.

If the class doesn't implement to_s Object.to_s kicks in and displays something like "#"

Enumerable is really a mixin https://ruby-doc.org/core-2.6.5/Enumerable.html but join is not listed in its methods.

There is another reply of mine with an example of a class can be used in join and doesn't mix in Enumerable.

Re: Motivation – Keli Language

#216
post #208

Earlier quoted context omitted.

For details of the interfaces that the class inherits from, see: https://docs.spring.io/spring-framework/docs/current/javadoc... https://docs.spring.io/spring-framework/docs/current/javadoc...

The guy next to me on the bus is asking why I'm laughing so hard. I'm not sure how to respond. "These class names are really funny!"

InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState

Re: Motivation – Keli Language

#217

Why is no one talking much about Scala? ( https://docs.scala-lang.org/overviews/scala-book/functional-... )

Because we're trying to turn people on to functional programming, not off EDIT: Downvotes already? Look, Scala is NOT noob-friendly, and it's a rational argument, not a preference. Here's an example: There are at least 10 (TEN) different uses of the underscore character (_) in Scala. JFC. I can go on, such as the proliferation of bizarre operators everywhere that are impossible to Google (again, not noob-friendly), t…

> and it's a rational argument, not a preference

It might have some justification, but it's just your preference. Scala gained a reputation of being a "difficult" language early on, I suppose mostly by people coming from Java, and it has unfortunately stuck.

Singling out underscores in Scala as "difficult" is bizarre. There might be many, but in practice it's very easy to understand what you want, and I've never seen anyone seriously confused by them. What do you mean, "many bizarre operators"? Are you using ScalaZ maybe?

What do you mean, JVM stacktraces are not newbie-friendly? They are a useful tool to troubleshoot many problems. What problems do they have in your opinion?

What's wrong with relying on the JVM?

Scala type signatures are sometimes hard to understand in library code. You are not expected to write code like that unless you are writing general purpose libraries, which you are likely not doing.

Re: Motivation – Keli Language

#219

The author lists Ocaml as "non-IDE-friendly." This is not my experience. Ocaml is one of the most IDE friendly languages I have in my toolkit right now -- not just functional languages, but all of them. Ocaml + Emacs + Merlin is stable, accurate, very fast (responsive), and easy to set up and configure. Plus, named and named-optional parameters are supported in the language, and can be used to good effect for disambi…

Any language is non-IDE-friendly compared to what you have out of the box for languages such as Java, C# and even Python in IntelliJ's IDEs. Most languages at most have autocomplete and definitions look up (and even those are often very brittle). That is a far cry from what an IDE should be able to provide. Granted, recently I only tried OCaml via Reason, but I remember that some of the errors the compiler produces a…

I agree that IntelliJ is excellent for Java, and assume it is for C# (though I haven't used it for that). It's my go-to tool for Java development. In my experience, it's good for Python that doesn't have type annotations -- it's remarkably smart really, considering the challenges of autocomplete for dynamic languages -- but not truly great. Better than nothing, certainly!

I can't speak to Ocaml in IDEs other than Emacs, but in my experience, error messages are quite location-precise, down to the specific word(s) on the line causing the error; and the messages are readable with a little practice. They are not as good as, say, Rust's error messages, but you get used to them fairly quickly! But that's more a condemnation of the compiler, not of the IDE.

There are a few esoteric error types in Ocaml ("Expected a value of type 'a, but you gave a value of type 'a" -- OK, that's a head-scratcher) but those are very infrequent in typical code.

Re: Motivation – Keli Language

#220
post #75
post #25

I find the syntax as the author intended it to be: clean. I agree with the ambiguity of positional parameters at first glance. Although named parameters (e.g. in Scala) somewhat solve this, they are optional. Having the parameters with their explicit name makes it quite readable. myList .append(5) .reverse .put(5) atIndex(0) .++(anotherList) .select(x | x.isEven) Edit: The same feature makes it look a little weird wh…

$.name("Keli" :age 50).isOld wold've been nicer to me but ah well.

I can understand $.(:name "Keli" :age 50) but not $.name("Keli" :age 50), why should the age bit go inside the parens? This introduces an asymmetry where the first key appears outside parents and subsequent keys appear inside (and as colon-initialed keywords?!)
Post reply on HN