Live data from Hacker News

Closing this as we are no longer pursuing Swift adoption

github.com

261–270 of 332 posts

Re: Closing this as we are no longer pursuing Swift adoption

#261
post #213

[flagged]

Bringing up Rust as an obvious alternative is not toxic.

it's toxic because of how it sometimes materializes:

- predictable

- incessant

- with belittling/reductionist/arrogant/elitist/combative phrasings

- handwaving rust shortcomings and tradeoffs

Re: Closing this as we are no longer pursuing Swift adoption

#262

Earlier quoted context omitted.

Not sure how I feel about Shakespeare and JK Rowling living in the same parenthesis! Computer languages are the opposite of natural languages - they are for formalising and limiting thought, the exact opposite of literature. These two things are not comparable. If natural language was so good for programs, we’d be using it - many many people have tried from literate programming onward.

I fully accept that formalism is an important factor in programming language design. But all HLLs (well, even ASM) are a compromise between machine speak ( https://youtu.be/CTjolEUj00g?si=79zMVRl0oMQo4Tby ) and human speak. My case is that the current fashion is to draw the line at an overly simple level, and that there are ways to wrap the formalism in more natural constructs that trigger the parts of the brain that…

How is that snippet any better than:

x := 42

Or

let x = 42

Or

x = 42

It seems like a regression from modern languages.

Re: Closing this as we are no longer pursuing Swift adoption

#263
post #175

Earlier quoted context omitted.

You can, but then you don't get any of what OOP actually offers. Message passing isn't the same thing as dynamic dispatch. OOP is a very different paradigm.

I think you are both unknowingly talking past each other: my understanding is that Smalltalk-style "object-oriented programming" ("everything is a message!") is quite distinct from C++/C#/Java/Rust "object-oriented programming" ("my structs have methods!")

Right, the former is what OOP is. The latter, encapsulating data in "objects", is functional programming.

Re: Closing this as we are no longer pursuing Swift adoption

#264

Earlier quoted context omitted.

I never heard of hardware without one

Avoiding interacting with LLVM as a user doesn't mean you've created something equivalent to LLVM. And if the C compiler you use is clang then you're still literally making use of LLVM.

I don't know what point you're trying to make but your question was what's an alternative to llvm. People writing compilers always used C89 or a version of it (C11 allows an easier atomic implementation). There's a lot more C89 compilers than backends that llvm supports. When I was writing arduino code clang/llvm couldn't generate the AVR code for the board. The default toolchain was gcc with an AVR backend. IIRC it had optimizations and was the only reasonable compiler I could use. There's nothing wrong using C as your backend

Re: Closing this as we are no longer pursuing Swift adoption

#265

Earlier quoted context omitted.

It doesn't seem uncommon for someone to generally like Rust but still want to use something OO for UI. I'm in that boat. Never liked OOP much, but it makes sense sometimes.

What OO features are you thinking of that Rust doesn't have? Traits give you the ability to model typical GUI OO hierarchies, e.g.: trait Widget { fn layout(&mut self, constraints: Constraints); fn paint(&self, ctx: &mut PaintCtx); fn handle_event(&mut self, event: Event); } struct Button { ... } struct Label { ... } impl Widget for Button { ... } impl Widget for Label { ... } let mut widgets: Vec > = Vec::new(); Imp…

You can do OO this way if you really want in Rust, kinda like how you can do it in C, but it gets cumbersome. Especially because there's no GC.

Re: Closing this as we are no longer pursuing Swift adoption

#266
post #213

[flagged]

It is a genuinely strange social phenomenon. What is it about Rust specifically that attracts these people?

I think they are mostly just idealists. Found a perfect programming language that allows them to claim that everything else is wrong, and rust can solve every problem under the sun.

Re: Closing this as we are no longer pursuing Swift adoption

#268

Earlier quoted context omitted.

Perlis's 10th epigram feels germane: > Get into a rut early: Do the same process the same way. Accumulate idioms. Standardize. The only difference(!) between Shakespeare and you was the size of his idiom list - not the size of his vocabulary.

Well sure - being in a rut is good. But the language is the medium in which you cast your idiom, right? Here's a Python rut: n = 20 # how many numbers to generate a, b = 0, 1 for _ in range(n): print(a, end=" ") a, b = b, a + b print() Here's that rut in Raku: (0,1,*+*...*)[^20] I am claiming that this is a nicer rut.

  seq = [0,1]
  while len(seq) 
> I am claiming that (0,1,+...*)[^20] is a nicer rut.

If it's so fantastic, then why on earth do you go out of your way to add extra lines and complexity to the Python?

Re: Closing this as we are no longer pursuing Swift adoption

#269

Earlier quoted context omitted.

What OO features are you thinking of that Rust doesn't have? Traits give you the ability to model typical GUI OO hierarchies, e.g.: trait Widget { fn layout(&mut self, constraints: Constraints); fn paint(&self, ctx: &mut PaintCtx); fn handle_event(&mut self, event: Event); } struct Button { ... } struct Label { ... } impl Widget for Button { ... } impl Widget for Label { ... } let mut widgets: Vec > = Vec::new(); Imp…

You can do OO this way if you really want in Rust, kinda like how you can do it in C, but it gets cumbersome. Especially because there's no GC.

But it's not "kinda how you can do it in C". Traits are a core feature of Rust, any non-trivial Rust program uses them. Traits alone give you polymorphism across disparate types, exactly as in OO - actually better than standard OO (without interfaces), because trait polymorphism works without requiring inheritance from a common ancestor.

> Especially because there's no GC.

This is the only real issue I can think of. However, for implementing something like a UI, automatic GC isn't really necessary because the lifetime of widgets etc. maps very well to the lexical/RAII model. Windows own widgets, etc. Again, see all the UI toolkits implemented in Rust.

Re: Closing this as we are no longer pursuing Swift adoption

#270

Earlier quoted context omitted.

Why not rust? It's popilar, in wide adoption, with wide support, without the baggage of C++. What'e the downside?

It is not backward compatible, the library system is immature, and there is no variety of different compilers for the language.

> the library system is immature

Hoo boy, wait until you hear about the state of C++'s library "system"

Post reply on HN