News for hackers. Stuff that matters.
Re:Python’s tug of war between beginner-friendly and advance... by marmada on Thursday February 04, 2021 @07:17PM (#26031405)
I've been thinking for a while that it's about time a new (maybe jit compiled?) language hits the scene with:

- A simplified/sounder natively integrated version of Typescript's type system - Javascript's easy notation for manipulating objects - None of Javascript's other baggage/cruft - Something akin to go routines

Basically, something with the performance of Go/Java (so there would be no need to rewrite your code once it starts serving millions of people) but the elegance of Typescript.

Not sure if this is similar to your vision of a "next Python" but it feels somewhat similar.

Basically I think right now:

C -> Zig

C++ -> Rust

Java -?-> Go

Python/Javascript --> ???

With native typing we could get a language as fast as Java/Go but with the cleanliness of Typescript.

Re:Python’s tug of war between beginner-friendly and advance... by BadInformatics on Thursday February 04, 2021 @07:30PM (#26031555)
I remember a few years back when Nim was going to be the next big thing here, but unfortunately it never gained that level of traction. Still an interesting language even without bigco levels of support behind it.
Re:Python’s tug of war between beginner-friendly and advance... by pjmlp on Friday February 05, 2021 @03:27AM (#26034232)
> C -> Zig

If dealing with uses after free and lack of bounds checked access in release code is still a fun factor.

> Java -?-> Go

Not at all, unless one misses Java 1.4 with loots of if/else boilerplate.

Re:Python’s tug of war between beginner-friendly and advance... by cassepipe on Friday February 05, 2021 @06:12AM (#26035102)
- But huh, if you checked that at runtime compiling un debug mode, and then you compile you compile the exact same code... It should be OK right ?

- I think you're right. C is more l'île a garbage collected C.

Re:Python’s tug of war between beginner-friendly and advance... by pjmlp on Friday February 05, 2021 @06:48AM (#26035306)
Big if, specially if you haven't tested all use cases.

It is the same fallacy as C code is safe if everything was checked, while CVEs keep happening.

Re:Python’s tug of war between beginner-friendly and advance... by jamil7 on Friday February 05, 2021 @02:20AM (#26033946)
Swift would be a candidate and is a great, progressively disclosed language, simple enough for beginners but scales up in advanced features. It’s attachment to Apple puts a lot of developers off but there is a lot of work going into windows and linux support as well as WASM. One issue is compile times right now.
Re:Python’s tug of war between beginner-friendly and advance... by jshen on Thursday February 04, 2021 @09:10PM (#26032257)
Typescript is not clean because it has to accommodate every crazy thing people do in raw JavaScript.

Having said that, isn’t Deno close to what you’re looking for?

Re:Python’s tug of war between beginner-friendly and advance... by marmada on Friday February 05, 2021 @12:55AM (#26033559)
I actually really like TS's type system precisely because it is insanely flexible.

I can write statically typed code that easily shapes & reshapes objects & code that fits functional or object oriented programming styles.

It's a statically typed language that feels dynamic.

Now, if I were to get a version of TS without all of JS's crutches that would be amazing.

Deno is pretty close, but it lacks on performance & is bounded in potential by JS (in some aspects).

Re:Python’s tug of war between beginner-friendly and advance... by bambataa on Friday February 05, 2021 @04:03AM (#26034408)
I live in hope that, one day, TS will loosen its links to JS.

Things like `Object.keys` irritate me because they don’t compose well. What would go wrong if TS started supporting `Object.prototype.keys`? Could even be implemented as a rewrite using `Object.keys`.

Re:Python’s tug of war between beginner-friendly and advance... by jshen on Saturday February 06, 2021 @02:53PM (#26049347)
I’ve been thinking about this, and I never thought of it before. I would love a language that is both dynamic and static similar to JS and TS. but, when the types are provided, use them to compile to fast code, while keeping the ability to do dynamic scripting.
Re:Python’s tug of war between beginner-friendly and advance... by proto-n on Friday February 05, 2021 @06:03AM (#26035044)
What do you think of Dart? It's still evolving, but for me it ticks all those boxes.
Re:Python’s tug of war between beginner-friendly and advance... by nmfisher on Friday February 05, 2021 @06:18AM (#26035124)
I’m overwhelmingly favourable towards Dart. While I picked it up for mobile (Flutter) dev, I’ve been slowly replacing a lot of scripting/backend work with it too.

It’s the ideal replacement for general purpose scripting and browser work IMO. I can’t recommend it enough.

Re:Python’s tug of war between beginner-friendly and advance... by miles7 on Thursday February 04, 2021 @11:11PM (#26033014)
What’s your opinion on Julia?
Re:Python’s tug of war between beginner-friendly and advance... by valenterry on Thursday February 04, 2021 @08:32PM (#26032015)
Scala comes very close to that.
Re:Python’s tug of war between beginner-friendly and advance... by pbourke on Thursday February 04, 2021 @09:15PM (#26032289)
Scala is nowhere near as approachable as Python or Typescript
Re:Python’s tug of war between beginner-friendly and advance... by valenterry on Thursday February 04, 2021 @10:08PM (#26032605)
Why do you think that?
Re:Python’s tug of war between beginner-friendly and advance... by benhoyt on Thursday February 04, 2021 @10:18PM (#26032673)
At least when I used it ~2 years ago: an extremely complex type system with a huge learning curve (unless you're going to just write Java in Scala), poor documentation, and a very slow compiler. That's to say nothing of the JVM-based runtime.
Re:Python’s tug of war between beginner-friendly and advance... by doliveira on Thursday February 04, 2021 @10:50PM (#26032891)
I got really frustrated one of these days because I reached the 20-something limit for fields in a case class and I had to change a lot of my architecture. It was a Spark job so I needed all those fields in that structure.

Not sure if that's because I'm a beginner or if it's just Spark itself, but Scala errors are impossible to decrypt.

Re:Python’s tug of war between beginner-friendly and advance... by valenterry on Thursday February 04, 2021 @10:58PM (#26032941)
Ah yeah, that was really a stupid limit.

Time to bump Scala to version 3 so that you don't have the 22 case class field limit anymore. :)

See here: https://dotty.epfl.ch/docs/reference/dropped-features/limit2...

Re:Python’s tug of war between beginner-friendly and advance... by valenterry on Thursday February 04, 2021 @10:57PM (#26032931)
> unless you're going to just write Java in Scala

That is what I mean though - but I would replace "Java" with python here. Just stay away from all the complexity and write python code. It's pretty simple and some people argue it's the better way to use Scala.

Re:Python’s tug of war between beginner-friendly and advance... by pbourke on Thursday February 04, 2021 @10:29PM (#26032760)
Scala’s implicits, mutable/immutable collection bifurcation, infix/dot syntax interchangeability for method invocations, tendency of libraries to implement their own mini language, ...
Re:Python’s tug of war between beginner-friendly and advance... by valenterry on Thursday February 04, 2021 @10:56PM (#26032925)
As a beginner, you don't really have to use Scala's implicits or "infix/dot syntax".

Just like how you don't have to use type annotations, generators, decorators, context managers in python.

Same for libraries.

At some point you will stumble upon a library that forces you to understand them or you even write one yourself, but that is not something that stops you in the beginning.

Re:Python’s tug of war between beginner-friendly and advance... by random5634 on Thursday February 04, 2021 @11:24PM (#26033081)
It does.

Go got this right. If you want to read code, contribute to a large code base, folks will be using the features of the language, including the weird ones. Go has kept things very simple (relatively) in terms of core language. Some things were beyond basic (error handling? no generics?) But boy did it make it easier for contribute and understand code.

def Hi() = "hi" Hi() Hi

Yes, those two variants both work?

Re:Python’s tug of war between beginner-friendly and advance... by valenterry on Friday February 05, 2021 @12:23AM (#26033402)
> If you want to read code, contribute to a large code base

Sure, but in that case, is python really beginner friendly? I don't think so. I had the impression we were talking about starting out with the language and building the well-known todo-list to learn the basics.

Also, golang is a rather young language and it will go the way that all languages go: it will get more and more complex because the more experienced developers want to improve their productivity with better language features. Remember the "no generics" thing? Well, now the generics will be added - I predicted this to happen. And just wait, other features will follow...

Re:Python’s tug of war between beginner-friendly and advance... by random5634 on Friday February 05, 2021 @03:32PM (#26040833)
It was originally. But agreed, less so now.

They've been adding some really more edge / line noise type features. Consider the walrus operator? You can do pretzel magic with this which make figuring out scope and what happened to what difficult.

I love the old way.

with open(…) as f: for line in ...

And I wish they'd just made more things iterable maybe or fixed some of the regex match stuff?

Re:Python’s tug of war between beginner-friendly and advance... by ledauphin on Thursday February 04, 2021 @09:09PM (#26032252)
the JVM is an incredibly heavyweight runtime compared to CPython. I don't think we're going to find the next beginner-friendly language coming out of the most professional runtime in human history.
Re:Python’s tug of war between beginner-friendly and advance... by valenterry on Thursday February 04, 2021 @10:12PM (#26032629)
True, but I don't think that is what the OP was taking about. The language itself is rather independent of the runtime. Scala compiles to native code or Javascript as well.
Re:Python’s tug of war between beginner-friendly and advance... by pbourke on Thursday February 04, 2021 @09:17PM (#26032305)
> incredibly heavyweight runtime

The apps may be heavyweight, but the runtime was designed to run on set-top boxes 25 years ago.

Re:Python’s tug of war between beginner-friendly and advance... by jaytaylor on Thursday February 04, 2021 @10:00PM (#26032558)
The JVM is definitely memory hungry (excluding cherry-picked examples such as 'set top deployments' or the Java Ring from the 90s), moreso than any other language runtime referenced in this discussion.