Fork me on GitHub
#other-languages
<
2024-05-15
>
Luke Zeitlin10:05:05

looking for something similar to https://github.com/djblue/portal but for python. Any recommendations?

john11:05:10

José Valim giving Elixir keynote, explaining how objects leak their identity semantics to their ancestors. There's a lot of kindred spirit between Elixir and Clojure. https://youtu.be/agkXUp0hCW8

👍 2
john11:05:45

And so languages have to add keywords like "protected" just to make up for the new problem objects introduce by leaking their state to ancestors

john11:05:01

Interesting talk

didibus23:05:25

Anyone uses Typescript extensively? Do you like it/not? Why? And how does it compare to say Java ?

Mario Trost06:05:04

I used to use it extensively. Liked it well enough but a tight editor integration is needed imo, so you get all warnings/errors while writing your code, not only when compiling/type checking. In VS Code that comes for free. auto-completions are powerful and a little underestimated in the Clojure community. You don’t have to leave your editor to see what parameters a function accepts or requires and what it returns. So consuming typescript code is awesome, even if you yourself only write Javascript (assuming the typescript doesn’t lie to you). Writing typescript can be cumbersome, but being familiar with the most important https://www.typescriptlang.org/docs/handbook/utility-types.html helps a lot, e.g. ReturnType, Awaited, Omit, Pick I don’t have enough Java experience to make any definite call there. Typescript has pretty good type inference which Java lacked completely when I used it directly, but I think there’s now var ? Also Typescript can lie to you where Java won’t. Just from a vibes perspective: I definitely like writing Typescript more than Java.

👍 1
jumar06:05:40

> auto-completions are powerful and a little underestimated in the Clojure community. You don’t have to leave your editor to see what parameters a function accepts or requires and what it returns. Do you need to do that with Clojure?

Mario Trost09:05:13

No and that’s why it’s underestimated.

jumar06:05:35

I just don’t see why and how is autocompletion underestimated in the community

Mario Trost06:05:33

You think autocomplete is useful in other languages (that aren’t a Lisp)?

didibus20:05:57

Ya, this is where static types are nice, you can get type filtered auto-complete. Where in Clojure it just auto-completes everything that's required.

didibus19:06:46

I do find TypeScript pretty similar to Java, or maybe more C# which in-turn is pretty similar to Java. I think that's kind of the idea. Bring JavaScript closer to Java/C# by introducing class-based OOP.

didibus19:06:25

the type differences are mostly for compatibility with JS.

didibus19:06:04

That said, yes it's about the tools, but the programming language can make making tools harder or easier. In this case, for auto-complete, it's much harder in Clojure, as the tool has an impossible time analyzing the source and figuring out what functions support the type of value being called upon.

didibus19:06:19

In other words, you should also consider a static type checker is just another tool. It runs at dev time, it's there only to help you, it serves no purpose in the actual running application. But such a tool necessitate a lot of annotations, and/or complex non-trivial inference algorithms (which are also restricted by the language to some extent).

Mario Trost20:06:08

> I do find TypeScript pretty similar to Java, or maybe more C# which in-turn is pretty similar to Java. I think that's kind of the idea. Bring JavaScript closer to Java/C# by introducing class-based OOP. > I never associated Typescript with class-based OOP and never wrote a single class in either JS or TS :thinking_face:

Mario Trost20:06:45

I know (part of?) Microsoft uses very OOP flavoured JS and TS but I'd always assumed OOPlers in JS/TS are a minority.

Mario Trost20:06:20

You work with classes in TS?

didibus14:06:29

I don't work extensively with Typescript, so I won't consider myself the authority on it, but most of the typescript I see seems to make extensive use of classes and interfaces. And the general feeling I get is that this is the encouraged way to program in it.

didibus14:06:59

And there's just how it adds back all of the class features to JS. It adds abstract classes, static members, access modifiers, and interface implementation.

octahedrion06:06:06

"consider a static type checker is just another tool" agreed, and for Clojure we have Spec/Malli and Typed Clojure

Drew Verlee19:08:31

Whats an example of something that's being "auto completed" in typescript that isn't in clojure? I assume were talking about this experience?

Drew Verlee19:08:39

I think what confuses me is that I have never created a vector (e.g [1, 2]) without some consideration about what i was going to do to it in the first place. e.g map over it.

Drew Verlee19:08:52

I'm immediately confused by some of the feedback the typsecript tool chain gives me. For instance, i can't concat these two lists:

Drew Verlee19:08:13

and yet it's fine with this:

didibus20:08:41

That's some TS type inference weirdness. When you do [1, 2] it infers this as a homogenous list of numbers. So you can't add string elements to it. When you do [1, 2, "3", "4"], it infers this as a heterogenous list of numbers and strings.

didibus20:08:27

You can probably type hint that [1, 2] should be a list of number and string, and then it won't show you that you can't concat strings to it.

didibus20:08:20

I think the auto-complete that's more cool to me from TypeScript is actually

didibus20:08:36

Or a more complex example. Here you say SomeMap has key a and b. So now when you use this map, it auto-completes a and b as keys on it. But you also say that it can have more keys of string -> number. So it lets you add more keys to it as well. It won't let you remove a or b from it though. Those added keys, it cannot auto-complete, because they are dynamically added. Though you could change the type after adding them to a new type that contains them, and that would auto-complete again.

👀 1
didibus20:08:19

If you pressed m. it would auto-complete and show you a or b.

👀 1
didibus00:08:37

You can also declare c in advance as optional, and it'll auto-complete it too. So basically, tracking map "types" does give you nice auto complete haha.