132 points · by MaysonL · 4y ago · 125 comments
I'm quite convinced he's onto something.
Note: very pleased that the box serving the site is pretty consistently at less than 1% CPU during the HN hug of death.
The connection has timed out
Tempt not the fates, for they are cruel -- or, alternatively, the "hug" is not one thing
---
https://github.com/mpw/Objective-Smalltalk#readme is the repo linked from the Download page in Wayback, for those into such things (but based on a recent commit, it's not Open Source: https://github.com/mpw/Objective-Smalltalk/blob/master/Stsh/... )
Just checked and it's still up, hasn't even restarted.
Not sure why you think the presence of copyright makes something open-source. All open-source licenses depend on copyright, otherwise the code would be in the public domain.
So, yes, AIUI all creative works ever have copyright, but only Open Source grants rights to others, such as folks who might want to contribute to your project
Are the mechanisms for defining architectural styles and some predefined styles (OO call/return, pipes & filters, REST and event broadcast) all that is new from Objective-S? Any other future goals? These seem relatively easy to implement as e.g. Lisp macros? Clojure supports many of these.
Personally, I would like to see more research in program semantics. I think languages should try to reduce expressiveness whenever possible by offering mechanisms to do so, i.e. DSLs and DSL tools. Along with the total lack of popularity of design-by-contract / Hoare logic / refinement types, I think this is the biggest mistake in modern language design.
In other fields, engineers strive to use components and to combine them in ways that yield artifacts with provable properties. An elementary example of this are truss structures in mechanical engineering.
There is not that much research direction in this area. Personally, I like Dafny [2]. There is quite a lot of research on advanced type systems and theorem proving, but I think there is still a big gap in usability and automation. I think DSLs to restrict semantics + automated program analyses could be an excellent alternative. Infer [3] is pretty nice. Similar approaches that targeted a language with better semantics would be able to offer a lot more guarantees.
Is functional programming yet another style, or is it a subset of call/return, or a subset of pipes & filters? If it is its own style, how might Objective-S implement this style? What would map-reduce look like? What about higher order functions and currying?
Or is Objective-S itself at root a functional language? You've said very categorically in another comment that Objective-S is NOT just reinventing Lisp. Can you explain?
Perhaps my questions don't make any sense. As I said, I'm no meta-language expert.
Provided i correctly understood Objective-S endgoal, what makes you think integrating them into a language runtime will lead to better results ?
May I ask what you would be interested in doing with it?
Is this meant to be used for creating GUI apps? Because if it is, relying on the ancient GNUStep for multiplatform support seems suspect. And if it's primarily intended for Mac/iOS development, then why should someone use this over Objective-C/Swift?
(btw no hate for GNUStep here, I've played with it in the past and think it's awesome, just not very relevant nowadays)
> It uses the host platform's C ABI. It dose not require a VM.
to me thats whats cool about obj-c, not the syntax or whatever, but the runtimethat you can construct classes and methods at runtime just like a "vm" but much simpler and lightweight... its amazing to me that apple never made a construct-the-app-while-its-running type of rapid development tool... the pieces were all there afaik
That is because we still don't have the equivalent of the Arch. That allows Notre Dame to have 3 times the volume of the keeps pyramid with a third of the mass."
Since it seems you are building such an arch I thing a good name could be:
NotreDameLang. ArchLang.
I looked at this and browsed some of the examples, and something clicked for me finally. I did a good solid 20 years of dedicated Smalltalk. When I started doing Objective-C, I was glad I could send messages, but noticed a number of differences. One of the things that you don't see just comparing syntax between Smalltalk and Objective-C is some of the deeper differences. Objective-S, like Objective-C, has type annotations. In ObjectiveC, there is a preference for void return types. Smalltalk, has no annotations, but all functions methods return. If you don't specifically return something from a method, self is the implicit return type. For any closure, it's always the last value of the expressions. It made cascading messages really easy, because methods tended to return the thing you wanted most of the time. When I started doing Objective-C, I commented on this lack of object return. I don't recall what the answers were, but it was clear that ship had sailed. :)
Since then, as I've sailed with Swift and Kotlin and Python, it's clear that that is the dominant pattern. Python, which doesn't have types, still returns None when nothing is specified. And then last year, I did some work on Erlang/Elixir. Like Smalltalk, all functions return something. You can return nil if you want, but you have to make the effort to do so. Otherwise, you just get the result of the last expression. And I loved it. It makes it so you can compose functional chains really easy and idiomatic.
It's led me to wonder why any language that wants to be more "functional" has a Void return type. And once again impressed that Smalltalk, for all of its OOness, is really quite functional in some ways. Functional programming, is of course, many things. But one of them is obviously the good old f(x) -> y thing we learn in high school. Functions take input, and return output. A function that returns nothing, isn't that useful. But we also have computerese "functions" that are more "subroutines". An imperative sequence of steps designed to produce a certain side effect. When one makes a Void function, it seems one is essentially saying "not interested in functional here, just want side effects." I'm not as opposed to side effect programming as some, but I guess I prefer the approach like Smalltalk and Elixir which strongly encourages returns of some value (even if ignored) so that one can be simultaneously functional and side-affecty.
I'm disappointed that Objective-S didn't embrace the no-such-thing-as-a-void-return philosophy of Smalltalk, even while lifting so much from Smalltalk.
thanks for the kind words!
Objective-S tries to be expression-oriented in its call/return parts, it even goes a bit further than Smalltalk in that the return of a method is the last expression of the method (like Erlang/Elixier, if I understood you correctly, and like Smalltalk blocks). For example here are some methods:
-<int>numberOfSteps { 8. }
-description { "<Task: title: {this:title} done: {this:done}>". }
and some property paths: /:table/:index {
|= { self dictionariesForQuery: "select * from {table}" | at: index. }
}
/:table {
|= { self dictionariesForQuery: "select * from {table}". }
}
/:table/:column/:index {
|= { self dictionariesForQuery: "select * from {table}" | at: index. }
}
/:table/where/:column/:value {
|= { self dictionariesForQuery: "select * from {table} where {column} = {value}". }
}
In fact, I don't even have a return statement. I am not sure I can keep that up, but so far it appears to be working out OK. I've appropriated the "^" to mean "send result to next filter" in the pipes/filter style: #!env stsh
filter toupper |{ ^object stringValue uppercaseString. }
(stdin -> toupper -> rawstdout ) run
This could probably be generalised so that it means "send result", which in a method means "to sender" and in a filter means "to next filter".Coming back to void: if I want to have interop with Objective-C, I must also support void returns, and they do come in handy here and there. For example, stsh uses a method declaration in comments after the shebang to make scripts more method-like, including argument parsing and return values. The following script expects a single integer argument and prints the result of adding three to that number to stdout:
#!env st
#-addToThree:<int>arg
arg+3.
You will note that there is no printing code. The reason is that the "method declaration" says there will be a return value. That means stsh will take the value of the last expression of the script and print that. Very convenient (and "functional"/"expression-oriented"). It will also automatically parse the first command line arg to a number and assign to "arg". And if you don't give it an argument? ]./add3.stsh
<script> 1 missing parameters (of 1): arg = <missing>
However, sometimes you don't want the script to be expression-oriented, you want the script to be in charge of printing to stdout. The following script, for example, is stream-oriented, it does not have a return value per-se, but rather streams its results: #!env st
#-<void>sawk:<ref>file
file csv: { :time :latitude :longitude :depth :magnitude |
stdout println:"Magnitude: {magnitude} location: {latitude},{longitude} time: {time}".
}.
(You can give the script the URL of the US Geological Service's earthquake endpoint and it will print out the earthquakes nicely formatted): ] ./earthquakes-sawk.st https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_month.csv
Magnitude: 2.8 location: 58.3441,-133.2808 time: 2022-08-19T10:19:16.173Z
Magnitude: 0.35 location: 33.5856667,-116.8071667 time: 2022-08-19T10:18:54.980Z
...
In this streaming cases, having a return and being expression-oriented/functional does not make sense, and of course Objective-S tries to generalize beyond call/return.Objective-C's default return type actually is "id" [1], and methods tended to return either some result or self up to NeXTstep 3.3, just like Smalltalk. So what changed? Distributed Objects. If your receiver is a distributed object, having a return value means that you have to marshal something, send it over the wire and synchronise on the return value. So they removed the default self returns.
With regards to types: I like type annotations, as long as I am not forced to add them everywhere and not constrained to the expressiveness of the type system. Having a bit of (checked) documentation is super-helpful when browsing code, having to chase down senders and implementors in order to figure out what a method does is super annoying. And of course Objective-C (and C) interop is crucial, as is the ability to compile some code to be as efficient as equivalent C code without needing a Heldencompiler/HeldenJIT. As soon as I add native compilation :-)
[1] https://blog.metaobject.com/2014/03/cargo-cult-typing-or-obj...
Objective-S: architecture-oriented language based on Smalltalk and Objective-C - https://news.ycombinator.com/item?id=27100272 - May 2021 (54 comments)
Objective-Smalltalk: now serving its own web site - https://news.ycombinator.com/item?id=18964665 - Jan 2019 (26 comments)
So it creates a runtime directly on the silicon? no VM no GC?
How does free memory? Automatic reference counting?
I ask because every remote resource is unreliable on several levels, and it's often both important and impossible to figure out which level is misbehaving. (Is AWS down, Comcast, my router? Or did I fat-finger some part of the URI?)
> [...]we know some good architectural styles for software, those architectural are difficult to use, because they clash[...]
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.
a := flag ifTrue: { 2. } ifFalse:{ 3 }.
^ ?
if not a typo an odd inconsistency. NSString *myString = @"Hello";
NSString *second = [myString stringByAppendingString:@" World"];
[1]: https://stackoverflow.com/questions/510269/shortcuts-in-obje...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 a normal non bracket syntax and some extra facilities that it was missing.
It is such a wasted opportunity
What features in particular do you think represent unjustified complexity?
Swift is not my favorite, but I wouldn’t consider it to be a “kitchen-sink” language, and it’s certainly less complicated than Scala.
https://blog.metaobject.com/2019/12/the-4-stages-of-objectiv...
NSString* result = [NSString stringWithFormat:@"%@ %@", @"Hello", @"World"];Compare with
"Hello " + "world"
or if you hate operator overloading "{} {}".format("hello", "world")
f"{foo} {bar}"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.
Also, I've never heard of any serious iOS/macOS dev complaining about this.
ObjC is very simple (often confused with archaic), but also wildly complex. Once you wrap your head around the ObjC way of doing things, everything makes sense, is very consistent, and you could develop very effectively.
NSString *foo = [@"foo" stringByAppendingString:@"bar"];
It's not that bad. "foo" + "bar"The Add operation has a whole bunch of properties and this not only isn't most of them, it's arguably not any of them, the main argument for + as a string concatenate operator is "Well, people seem to like it". Which, I guess I/O streams doesn't even have that going for it, but it's a pretty terrible rationale.
Look, just grow string interpolate and write f"{foo}{bar}" or whatever as much as you like don't abuse unrelated operators.
const char *s = "foo" "bar"; id foo = [@"foo" cat:@"bar"];
I have a category method added to NSString: - (id)cat:(id)arg { return [self stringByAppendingString:arg]; }And, don’t forget to release your alloc’d objects (or use an auto release memory pool). There was no automatic memory management then!
Really? I stopped reading at this spot, since this claim is so ridiculous.
https://en.wikipedia.org/wiki/General-purpose_programming_la...
> Objective-S is possibly the first general purpose programming language. It makes creating well-architected and efficient programs not only straightforward, but easy, fun and fast.
> Yes, this sounds insane, programming languages we call "general purpose" number in at least the hundreds, starting with C, Java, Smalltalk, Ruby, Python etc.
> However, these are actually DSLs for the domain of algorithms, and this architectural mismatch, the fact that we have to use algorithm DSLs for tasks that are not primarily algorithmic in nature lies at the heart of much of the pain we have in software development today.
Just because we call something "general purpose" doesn't mean it actually is.
Implicit is the claim that C, Lisp, Modula-2 are not general purpose languages, which is ridiculous. You may not want to deal with C's various problems, and it may take pages and pages of code to do in C what one line of Objective-S could do, but doesn't mean it can't be done.
* OO and Call/Return: Supported by every OO language.
* Pipes and Filters: Supported by every functional programming language.
* REST: Supported by many modern languages. (Go springs to mind as a typical example.)
* Implicit Invocation / Event Broadcast: Supported by many modern languages.
They describe that on the site. The notion is that most of our modern languages are more geared towards expressing algorithms and data structures, and not so great for expressing programs better suited to different architectural styles that don't necessarily follow a strict call/return type of semantics.
That's not entirely wrong. You can build a library/eDSL in a call/return language that will implement other architectures, but it will still look and behave like a call/return abstraction. Ostensibly Objective-S's goal is to make programs written in other architectural styles look like they are expressed natively in those styles, rather than an embedding of that style in a call/return architecture.
I'd like to see Objective-S implement Prolog or other logic programming to put that claim to the test. The other architectures they list aren't too far from call/return style, but logic programming certainly is.
What we currently call general purpose languages are actually domain specific languages for the domain of algorithms.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.
1. https://en.wikipedia.org/wiki/S_%28programming_language%29
Suggestions?
Arches? Arch? (There was ArchJava, so there's a precedent).
ArchTalk?
The tagline could be "Objective-See is like Objective-C without the C"
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.
Lisp also seems to have a shortage of knowledgeable advocates who understands other programming languages enough to know that not everything is or needs to be a lisp.