looking for something similar to https://github.com/djblue/portal but for python. Any recommendations?
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
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
Interesting talk
Anyone uses Typescript extensively? Do you like it/not? Why? And how does it compare to say Java ?
No and that’s why it’s underestimated.
I just don’t see why and how is autocompletion underestimated in the community
You think autocomplete is useful in other languages (that aren’t a Lisp)?
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.
the type differences are mostly for compatibility with JS.
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.
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).
> 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 🤔
I know (part of?) Microsoft uses very OOP flavoured JS and TS but I'd always assumed OOPlers in JS/TS are a minority.
You work with classes in TS?
Whats an example of something that's being "auto completed" in typescript that isn't in clojure? I assume were talking about this experience?
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.
I'm immediately confused by some of the feedback the typsecript tool chain gives me. For instance, i can't concat these two lists:
and yet it's fine with this:
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.
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.
I think the auto-complete that's more cool to me from TypeScript is actually
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.
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.
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.
every time I hear about typescript the first "benefit" listed is always its IDE integration and code-completion, which to me is not a language feature it's a tool feature. What is typescript like as a language independent of the tools used to write it ?
you could say well they're the same thing they go together, and in some languages that's true, e.g. Smalltalk is a language and an OS and IDE/programming environment, they're all the same thing in Smalltalk but that's a unique language where the tools and language create eachother whereas Java and typescript aren't in such a feedback loop with their editing tools
so far from what I've seen of typescript it's as verbose and cumbersome as Java and so I can't see the point of learning it when we already have Java
Typescript is very different from Java: 1. strong(er) type inference 2. it’s a structural type system, i.e. types that have different names but identical members are for practical purposes the same
> 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?
"consider a static type checker is just another tool" agreed, and for Clojure we have Spec/Malli and Typed Clojure
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.
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.
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.