Live data from Hacker News

Objective-S: architecture-oriented language based on Smalltalk and Objective-C

objective.st

71–80 of 130 posts

Re: Objective-S: architecture-oriented language based on Smalltalk and Objective-C

#71

Earlier quoted context omitted.

I honestly can’t tell if the posts defending Objective C syntax are serious or not. Poe’s Law in action? Compare with "Hello " + "world" or if you hate operator overloading "{} {}".format("hello", "world") f"{foo} {bar}"

Your example is worse than stringWithFormat: for the same reason C++ iostreams are worse than format strings. It's hard to control once you want anything more interesting than + and it's not localizable. Complaining that a function call's name is too long doesn't matter at all.

If you think that function name length doesn't matter you haven't written enough ObjC yet. It matters. Source code shouldn't read like Tolstoy.

ObjC itself is not responsible, it's NeXT and Apple's fault for perpetuating that abominable naming convention for much too long.

As for localisation, only a tiny fraction of strings in a software program are user visible. I don't think we should be designing language syntax around that edge case.

Re: Objective-S: architecture-oriented language based on Smalltalk and Objective-C

#72
post #33

How much of this is tied to Apple frameworks? I noticed that the Linux support requires GNUStep, so I'm assuming quite a bit? The impression I'm getting is that this requires a non-trivial, Apple-flavored runtime to be useful. GNUStep apps are pretty awful experiences today due to being based on outdated Nextstep UI concepts that do no adapt well to anything other than MacOS. Is this meant to be used for creating GUI…

It seems the amount of code you need to write to get overly-specific common things done is extremely small compared to Swift, Obj-C, Rust, Java, Go, or Python.

Re: Objective-S: architecture-oriented language based on Smalltalk and Objective-C

#73
post #11

Earlier quoted context omitted.

Agreed. But once you get some macros (or categories) then Objective-C becomes a great language. Is both elegant and very powerful as it is has the perfect balance between a static and a dynamic language. Swift on the other had is a language where wonks decided to throw every silly feature they thought off to the point that is becoming more complex than even Scala. I wished Swift was just a modernized Objective-C with…

Objective-C is powerful yes, but elegant? Not sure. It can do everything but I always felt like it was basically the opposite of elegant.

I would describe it as practical

Re: Objective-S: architecture-oriented language based on Smalltalk and Objective-C

#74

I still remember my horror when I saw the pain of something as simple as string concatenation in Objective-C. The community literally has to write special micros to make joining a string palatable [1]. I salute the brave souls who made OSX/iOS apps before Swift. NSString *myString = @"Hello"; NSString *second = [myString stringByAppendingString:@" World"]; [1]: https://stackoverflow.com/questions/510269/shortcuts-in-…

NSString *foo = [@"foo" stringByAppendingString:@"bar"]; It's not that bad.

I use:

  id foo = [@"foo" cat:@"bar"];
I have a category method added to NSString:

  - (id)cat:(id)arg { return [self stringByAppendingString:arg]; }

Re: Objective-S: architecture-oriented language based on Smalltalk and Objective-C

#75

Earlier quoted context omitted.

"guard" is kind of useless but it's minor.

`guard` has its time and place, which is to refactor pyramids of doom away. The number of nested `if let` statements I've seen, and written, is upsetting.

Perl's "unless" syntax, or allowing "if"s at the end of a statement, also solve this and are more flexible.

Re: Objective-S: architecture-oriented language based on Smalltalk and Objective-C

#76

Earlier quoted context omitted.

Your example is worse than stringWithFormat: for the same reason C++ iostreams are worse than format strings. It's hard to control once you want anything more interesting than + and it's not localizable. Complaining that a function call's name is too long doesn't matter at all.

If you think that function name length doesn't matter you haven't written enough ObjC yet. It matters. Source code shouldn't read like Tolstoy. ObjC itself is not responsible, it's NeXT and Apple's fault for perpetuating that abominable naming convention for much too long. As for localisation, only a tiny fraction of strings in a software program are user visible. I don't think we should be designing language syntax…

I'm sure I've written more than most other people currently alive.

ObjC is one of the most readable languages around. That's mostly because of the param:value syntax, which is much better than C-like syntax because you can see the parameter names. But the long method names aren't a problem once you have autocompletion. They also make it clearer what the best name for a method is - if you call something fmt() you start needing to make up equally clever short names for everything else, and it becomes less principled.

For algorithmic string building, I'm not sure how often you want + (aka appendString:), appendFormat: or componentsJoinedByString: are more flexible.

Re: Objective-S: architecture-oriented language based on Smalltalk and Objective-C

#77
post #58

We already have LISP. Every once in a while someone invents a new language to solve some old problem, and as the new language evolves, it becomes closer and closer to LISP.

That's one thing I am acutely aware of and monitoring closely, and in fact it's one of the blog posts that's ripening to be released sometime: Am I building a Lisp?.

And every once in a while it looks like it might be that I am, in fact, arriving at a Lisp, but in the end they turn out to be false alarms, so the answer is still fairly resoundingly: No.

Re: Objective-S: architecture-oriented language based on Smalltalk and Objective-C

#78
post #39
post #32

Earlier quoted context omitted.

You picked a different tool for each of the different entry, while the author is arguing their programming language is general purpose, because it allow to do each entry you listed, in a single language.

Right. A different _tool_ because they described paradigms aren’t language paradigms- they’re patterns or frameworks expressed more easily but also more commonly in some languages than others because of completely unrelated historical accidents. We have different languages because we do different things with them, and any Turing complete language can achieve any desired program. So what we’re left with is a misunders…

Yes, exactly: these architectural styles should not be built into the language. And (mostly) aren't, in Objective-S. You should be able to build them yourself within the language and then they should have linguistic support that is as good / indistinguishable from built-in stuff.

Just like Smalltalk does with, say collections: most languages have/had built-in support for one type of collection (or maybe two), typically arrays of a homogenous type. If you wanted to build your own collection, you could, but were limited with functional call syntax fora accessing that collection.

With Smalltalk, collections yourself create are on an equal footing with collections that are in the base library. And that's an idea that has slowly percolated through the PL community and to practice.

But not with architectural styles. Our mainstream programming languages typically support exactly one architectural style: call/return. That's the only one that allows abstraction. If you want a different one, you can build it, but you cannot express it. And that's a huge problem, as any non-default architectural style gets a huge expressiveness penalty.

Previous languages that support alternative architectural styles usually have exactly the problem you've described: they offer exactly one implementation of that architectural style baked into the language, and that's it (Go channels are an example). And if you need something even slightly different, you're back in implementing + expressing with call/return, because that's the only style that allows abstraction. Sigh.

With Objective-S, the idea is that you get to implement whatever you want in terms of architectural styles (connectors, components) and then get to surface it with syntax appropriate for architectural connection. And the implementation will usually also be call/return based, because that's what we currently have. Although I am starting to see places where I can actually implement a connector in terms of other connectors directly without mediating via procedure calls.

(The one-way dataflow connector |= can be built from a storage combinator and a notification mechanism, and these can be pluggable. Very neat, particularly because building dataflow constraints naturally was one of my goals and this exceeds that goal).

Of course there's a bit of a chicken/egg problem, in two variations: first, I must provide some "built-in" components and connectors that go outside the default set, otherwise the whole thing is useless. And there it turned out that the initial set (polymorphic write streams, storage combinators, dataflow constraints) turned out so useful and general that they sort of become "the thing", even though they aren't. The second, related chicken/egg problem is that both conceptually and from an implementation POV, we have to start somewhere concrete, because this is an abstraction mechanism that doesn't exist yet and thus nobody really has a clue how it should work. So things aren't as abstract/general yet as they should be.

Re: Objective-S: architecture-oriented language based on Smalltalk and Objective-C

#79
post #28
post #9

Earlier quoted context omitted.

You might try reading further, because the claim is actually well-supported. Just because we call something "general purpose" doesn't mean it actually is.

In that case would you please explain this apparent bafflegab? What we currently call general purpose languages are actually domain specific languages for the domain of algorithms.

Hmm...not sure what you find gobbledygooky or jargon-y about this...it is about as clear as I can make it. I mean it is definitely a surprising even somewhat baffling insight, but once it is there it seems pretty clear.

I gave a longer explanation here:

https://2020.programming-conference.org/details/salon-2020-p...

(That paper is also linked from the publications page: http://objective.st/Publications/ )

Short summary:

1. Historically, computers were created to compute results (hence the name) using algorithms. So you have a function/procedure that you give parameters, it executes the algorithm, spits out the answer and terminates.

2. Programming languages reflect this. Heck, the granddaddy of most mainstream programming languages is ALGOL, the ALGOrithmic Language. https://en.wikipedia.org/wiki/ALGOL

3. The majority of programs/system today are not like (1). See for example Chatty:

    https://dl.ifip.org/db/conf/ehci/ehci2007/Chatty07.pdf
or also Guy Steele's opening statement for the "Objects have failed" OOPSLA panel:

    https://www.dreamsongs.com/ObjectsHaveNotFailedNarr.html
"Another weakness of procedural and functional programming is that their viewpoint assumes a process by which "inputs" are transformed into "outputs"; [...] Ongoing behavior, not completion, is now of primary interest."

Happy to answer any more specific questions. Again, the insight is definitely somewhere between surprising and outright baffling, particularly because call/return is very much paradigmatic in the Kuhnian sense: a set of shared and implicit assumptions, so things we don't even think about but that form the basis of everything else.

Re: Objective-S: architecture-oriented language based on Smalltalk and Objective-C

#80

found a typo > [...]we know some good architectural styles for software, those architectural are difficult to use, because they clash[...]

The author made a comment saying the website is not yet in a good state... I found lots of typos, if the author is interested:

Page http://objective.st/Language/:

* the "Object templates" sample code ends outside the code box. * Section "Messages": this whole sentence is basically a typo:

- expressions are handlde by message conneectors, and again like Smalltalk, Objective-S distinguishes three kinds of messaege... - Objective-S has two mechanisms for chaining muliple messages

What text editor is the author using? Virtually every editor nowadays supports spellchecking.

Post reply on HN