Live data from Hacker News

Motivation – Keli Language

keli-language.gitbook.io

221–230 of 300 posts

Re: Motivation – Keli Language

#221

If I want to do functional programming, I can do that just fine in most languages. If I want to do imperative programming, I can do that just fine in most languages, except for functional programming languages .

I think the key with a functional language is given a large codebase, you can reason about it functionally instead of hoping there's no imperative code in there (on purpose or by bug)

Kind of like if you're wearing a straitjacket, you don't need to worry about accidentally punching yourself in the face.

Re: Motivation – Keli Language

#222

Earlier quoted context omitted.

Well, we're used to the AbstractBeanHandlerFactoryFactories already. A slight discomfort of learning something new can seem much bigger when you're already acclimated to abuse.

Posting to name-drop SimpleBeanFactoryAwareAspectInstanceFactory

I'm glad we got the Simple one

Re: Motivation – Keli Language

#223
post #195

Earlier quoted context omitted.

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

oops, right you are, it's not defined on Enumerable (though i do wonder why! `each` does define an iteration order after all)

Re: Motivation – Keli Language

#224
post #217

Earlier quoted context omitted.

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…

> What's wrong with relying on the JVM?

It's that the user needs to learn not just Scala but also Java whenever they want to do anything "real". You might say this is a minor hangup, but for learners having to context switch back and forth between Java and Scala and dealing with interop issues can make for much more cognitive load than using a non-hosted language like Python or Go.

Re: Motivation – Keli Language

#225
post #27

Elm single handedly got me into functional programming. Everything from the syntax to the standard library. I haven’t used a language that was that elegant and delightful to use perhaps since I discovered Ruby. It makes me really sad that Elm turned to this niche language/framework that it is today. I had hoped for it to grow someday to have a mobile target in addition to web, to be able to use it on the server, hell…

This is not my first time hearing someone praising Elm's syntax and standard library. How does it compare to OCaml/F#/haskell?

Re: Motivation – Keli Language

#226

Earlier quoted context omitted.

> An api that was written to simply process a list of Orders into a Report might be abstracted into a fold on some monad, which at first seems a great idea. But if you're not careful, readability suffers a lot. It's much easier to get to know an application when its code deals with business objects that you already understand well, than to read hundreds of lines of code that deal only with abstractions. Do you have a…

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.

[deleted]

Re: Motivation – Keli Language

#227

Earlier quoted context omitted.

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

Do you have a recent example of an error of the form "Expected a value of type 'a, but you gave a value of type 'a"?

I have hoped to have eliminated all of them in 4.08.

Re: Motivation – Keli Language

#228

Earlier quoted context omitted.

Posting to name-drop SimpleBeanFactoryAwareAspectInstanceFactory

I'm glad we got the Simple one

Sometimes, though, you can only get the desired effect with SimpleBeanFactoryAwareAspectInstanceFactory_EX.

Re: Motivation – Keli Language

#229
post #58
post #37

Earlier quoted context omitted.

I also love Elm, but the fact that it is a niche language now doesn't mean it's all it ever will be. There's nothing really stopping anyone from adapting Elm to the server for example, but the reason it hasn't been done yet is because it's best to focus on solving one problem at a time. If Evan just translated the Node standard api 1:1 for example, it wouldn't be Elm or Node and there would be no reason to use it.

There's the core team, which is extremely unfriendly to any kind of user-driven development of the language. The whole reason Elm has been stuck in a niche when it had _huge_ hype around 2015 and everyone was sure it would be the "next big thing" on the front-end is that the developers have tried to keep full control of the language and keep shooting down proposals by users. It's either their way or the highway.

Is there any reason why a group of users didn't fork the language? Lack of coordination?

Re: Motivation – Keli Language

#230

I think it's great that Keli is designed with IDE support in mind. However I believe that this is only half of the reason why FP still doesn't really break through in the corporate world. The other reason is that many FP users are too enthusiastic about creating abstractions. This is of course something that FP is exceptionally well suited for. An api that was written to simply process a list of Orders into a Report…

> An api that was written to simply process a list of Orders into a Report might be abstracted into a fold on some monad, which at first seems a great idea. But if you're not careful, readability suffers a lot. It's much easier to get to know an application when its code deals with business objects that you already understand well, than to read hundreds of lines of code that deal only with abstractions. Do you have a…

I just wrote about some possible pitfalls down the ADT route: https://treetide.com/posts/domain-model-pitfalls-oop-fp.html

> As more operations are demanded, it is more likely that the existing partitioning of the world into the nice distinct cases won’t suit that operation anymore. Then, as a fix, we can introduce more specific cases, or make existing ones more general - leading to ambiguity, bloat and mental load for the existing operations.

Just an aspect.

Post reply on HN