Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
cinci zoo sniper
Mar 15, 2013




VikingofRock posted:

It sounds like dicts are out for harambescript?

Fortaleza posted:

Every declared variable is available globally ‘cause all shots are no-scope :blaster:

lmao :eyepop:

Adbot
ADBOT LOVES YOU

Neslepaks
Sep 3, 2003

VikingofRock posted:

It sounds like dicts are out for harambescript?

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



VikingofRock posted:

It sounds like dicts are out for harambescript?

Fortaleza posted:

Every declared variable is available globally ‘cause all shots are no-scope :blaster:

Cybernetic Vermin
Apr 18, 2005

immediately and reliably crashing the task/thread/unit on errors would be an improvement on a lot of error handling that's going on.

havelock
Jan 20, 2004

IGNORE ME
Soiled Meat

fart simpson posted:

well, if you mean hiding the messages down on lower levels then no, not really. but that's sort of an explicit choice. nothing in elm is done implicitly, the entire point of the design is to force you to handle every message and every case explicitly and structure the whole program as a single big tree. you can nest your structure by wrapping it but then you still need to pass the wrapped values up to the main structure that lives at the top of your program somehow. so in some sense you need to explicitly route everything still, yeah, and only the entrypoint source file can really have a direct line to the outside world, i doubt that will ever change.

but if you mean packaging up component templates or whatever, yeah you can do that just fine. you just have to handle all the messages and commands and all that explicitly and wrap or pass them up.

but i dont know what you mean about flattening stuff, it doesn't really force that. the normal pattern is to have a type definition for your Commands and Messages that basically just wraps the Commands and Messages from the next levels down, which do the same in turn

Thanks for this clarity - I'm not surprised they've stuck with what felt like an explicit choice at the time. My scenario (that I run into in basically every web app) is composite controls. For example, if we pretend that built in date pickers aren't a thing we can think of that as an example of a component. Maybe it's made of a button to show it, a bunch of links for days/changing months, a button for dismissing the popup thing, etc. The interface for this component if you designed it in isolation would probably be a property for the selected date and perhaps an event/message for when the date has changed. The page using this control doesn't care that it's implemented with a bunch of buttons and links....except in elm it has to because you have to handle all the messages about those internal only controls at the top level. God help you if you assemble composites into other composites.

The FP dual would be partially applied functions or something, but that doesn't mesh with pattern matching. I love pattern matching forcing you to cover the whole type, but using it for this feels really weird to me.

The answer I got at the time was 'do your composites in web components', which degenerates into the whole markup layer built in web components vs elm, which also seems weird.

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

rjmccall posted:

really just the implementation. most generics systems either rely on monomorphization (which requires code duplication, basically template instantiation) or erasure (which requires a fall back onto a common value representation, basically boxing). swift can actually run generic code without boxing anything. among other things, that means it can express some interesting things like dynamic dispatch to a polymorphic function that would be inexpressible in a c++/rust-like system

is that actually the language though or is it specific to the implementation

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
I still want a good and modern implementation of the original infix Dylan (with all the updates from the design notes that came after the original book, of course)

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

rjmccall posted:

yeah, this came up recently in a grey forum, and this is a much better thread to rant about how much goddamn work has been wasted just because guido thinks performance is the least important thing to prioritize in his language implementation. if it wasn’t something that people were doing for smalltalk in 1986, he’s not interested

there are worse aspirations

on the other hand “programming language” people seem to focus on the first clause of this sentence to the exclusion of all else: everything is typesafe and zero-overhead, but it takes a year and a day to tell you it won’t even compile because you missed an obscure constraint and it’s entirely impenetrable when you go to maintain it two years down the line

but hey your parser also never needs more than one token of lookahead, and really, isn’t that the most important aspect of language design?

cinci zoo sniper
Mar 15, 2013




i don’t feel that go and rust seek to occupy the same niche, but i may be wrong. to me it seems that rust wants to be a c++ with fewer runtime foot guns, whereas go is basically a faster python with “fearless” scalability

cinci zoo sniper
Mar 15, 2013




it does feel that every “upcoming non web language” is bleeding metal kind of thing, but that’s because if you’re smart enough to design a viable programming language you’re smart enough to not even bother competing against python on its home turf

gonadic io
Feb 16, 2011

>>=

cinci zoo sniper posted:

i don’t feel that go and rust seek to occupy the same niche, but i may be wrong. to me it seems that rust wants to be a c++ with fewer runtime foot guns, whereas go is basically a faster python with “fearless” scalability

The niche that rust and go share is "easier than C++, faster than the VM langs" on the server. The fact that rust doesn't have a GC is irrelevant for this use and almost a hinderance due to the complexity and learning curve that the borrow checker brings. You can see this directly in the calls, like "please give me a haskell but strict", for "please give me rust but with a GC".
In practice you can mostly get that effect by throwing around a lot of mutexes and RCs since you absolutely don't care about the last 20% of performance in this case.

gonadic io fucked around with this message at 12:11 on Nov 12, 2021

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
Yeah you can totally build stuff in rust without caring a lot about lifetimes. They only come into play when you want to be _really_ performant.

That said, writing all of the Arc<Mutex<Lowtax>> can be really noisy. Just being able to directly mark Lowtax as someone who can be garbage collected would be a nice bit of syntactic sugar.

cinci zoo sniper
Mar 15, 2013




gonadic io posted:

The niche that rust and go share is "easier than C++, faster than the VM langs" on the server. The fact that rust doesn't have a GC is irrelevant for this use and almost a hinderance due to the complexity and learning curve that the borrow checker brings. You can see this directly in the calls, like "please give me a haskell but strict", for "please give me rust but with a GC".
In practice you can mostly get that effect by throwing around a lot of mutexes and RCs since you absolutely don't care about the last 20% of performance in this case.

fair enough, that does make sense

gonadic io
Feb 16, 2011

>>=
the two also being new and cool and better for cvs than old boring stodgy langs like c#, java, and python absolutely is a factor too I'll be honest. when you're just in docker on the cloud or whatever you effectively have complete free reign of lang choice

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

Sagacity posted:

That said, writing all of the Arc<Mutex<Lowtax>> can be really noisy. Just being able to directly mark Lowtax as someone who can be garbage collected would be a nice bit of syntactic sugar.

Well, Rust has type aliases, so I guess you can just dump this in your utils.rs for starters:

code:
type GC<T> = std::sync::Arc<std::sync::Mutex<T>>;
And maybe you can write a macro so you can just add #[derive(GC)] over a type definition T and it'll be automatically 'upgraded' to ArcMutex<T> whenever used? IDK.

Side note, "Arc Mutex" sounds like a comic book macguffin.

gonadic io
Feb 16, 2011

>>=
arc mutex is a poor excuse for a real gc, both in terms of usability and practicality. there's efforts going on to develop stuff on in lib-space but not really any interest in doing anything new from the compiler side. just like the comparison to "haskell but strict" it's very much a language design choice and part of the unavoidable trade-off of the lang

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

eschaton posted:

is that actually the language though or is it specific to the implementation

swift the language allows things that otherwise it would have to disallow

there are languages with radically different basic implementation approaches and which therefore offer different basic language guarantees, such as ghc-extended haskell, that allow similar features

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Cybernetic Vermin posted:

immediately and reliably crashing the task/thread/unit on errors would be an improvement on a lot of error handling that’s isn’t going on.

gonadic io
Feb 16, 2011

>>=

gonadic io posted:

The niche that rust and go share is "easier than C++, faster than the VM langs" on the server. The fact that rust doesn't have a GC is irrelevant for this use and almost a hinderance due to the complexity and learning curve that the borrow checker brings. You can see this directly in the calls, like "please give me a haskell but strict", for "please give me rust but with a GC".
In practice you can mostly get that effect by throwing around a lot of mutexes and RCs since you absolutely don't care about the last 20% of performance in this case.

I really like Rust, it hits a lot of sweet spots for me – strongly typed, neat type system, the mild functional-ness thats useful while keeping people from going too crazy with functional patterns, usually low on boilerplate, static binaries, clever little things like ? ... but sometimes I wish there was a garbage-collected version of it, the constraints of the borrow checker make things like tree structures at least an order of magnitude harder to get right, and I'd love to have the ergonomics of the language and the ergonomics of a gc-ed runtime. Not going to happen I guess, but I feel like there's an opportunity for a Rust-ish language that is somewhat less finnicky, at the cost of making some abstractions more expensive, for microservices with complex business logic and such.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
swift really is trying to fill that niche, and there are people who've had success with it

cinci zoo sniper
Mar 15, 2013




unforunately swift also appears to have added windows support less than a year ago, and windows support in this case means a seemingly random person that has 150 other repositories releasing windows builds or something, which is really not something to want to see when you shop around with question "so is this useful on non-apple hardware as well". iirc the ide story used to be fairly restricted as well.

it's a cool language, but ultimately involves non-technical risk factors that no major language other than c# may invoke, and when that's the comparison i think most people will just settle on having to write an extra hour of magic syntax in rust or whatever

mystes
May 31, 2006

cinci zoo sniper posted:

unforunately swift also appears to have added windows support less than a year ago, and windows support in this case means a seemingly random person that has 150 other repositories releasing windows builds or something, which is really not something to want to see when you shop around with question "so is this useful on non-apple hardware as well". iirc the ide story used to be fairly restricted as well.

it's a cool language, but ultimately involves non-technical risk factors that no major language other than c# may invoke, and when that's the comparison i think most people will just settle on having to write an extra hour of magic syntax in rust or whatever
Yeah luckily most languages other than swift and c#, like Java, rust, elm, d, and typescript are not heavily reliant on single people/companies.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
i can understand that. fwiw, though, the windows support is official, it's not just some random dude in his free time

mystes
May 31, 2006

Swift seems perfectly good but it also doesn't seem like it's gotten enough traction outside of the apple ecosystem to be appealing right now for no particular fault of its own.

Oh also I forgot kotlin, lol.

cinci zoo sniper
Mar 15, 2013




mystes posted:

Yeah luckily most languages other than swift and c#, like Java, rust, elm, d, and typescript are not heavily reliant on single people/companies.

that’s not what i meant (lol at elm and d being considered major languages). what i meant is that as far as im concerned, apple is a hardware business notable for e.g. excluding nvidia cards from their computers or offering barely working software on windows, whereas everyone else, microsoft including, is forced to play at least somewhat nice on all platforms because what they offer is software, and mac users are premium segment. in other words, and i freely admit that i may not be the most attentive follower here, what i mean to say is that apple does not appear to be convincing a lot of people that swift is a language for everyone everywhere, and for me personally it doesn’t help that the only high profile swift project not targeting the apple ecosystem, that i know of, is the tensorflow swift fork that got killed early this year

hence, the seeming specifics of windows support for swift do rub me off the wrong way due to the overall context, for the purpose of consider swift as a prime contender for true multi platform development language - i cannot even tell if swift will receive windows updates if that maintainer gets hit by a bus. similarly, i would never consider c# in this specific situation either - see the recent hot reload debacle or dozens of .net and mono and whatever in the gently caress microsoft has pushed out in the recent decade, for example. oracle, as you invoke it, can go gently caress itself for 10000 and 1 reason, but i will never doubt that java will just work anywhere (but i would also not take up a greenfield java project, which i guess i could’ve qualified in a clearer way)

i don’t have a problem with single organisation dependency (as opposed to single person), but i definitely do lack facts to believe that apple specifically can consistently deliver quality software on windows

cinci zoo sniper
Mar 15, 2013




rjmccall posted:

i can understand that. fwiw, though, the windows support is official, it's not just some random dude in his free time

that’s good to hear. not sure if my reading skills are lacking, but it was not apparent if that just isn’t an ardent community volunteer, as the language website credits them separately

gonadic io
Feb 16, 2011

>>=
I don't know about swift but I remember having an absolutely awful time trying to do haskell dev on windows (about a decade ago at this point). Cabal/ghc itself worked fine but every third library very much assumed gcc on linux and gave at best token support for msys. It's probably much better now with WSL to be fair.

cinci zoo sniper
Mar 15, 2013




also, to be explicit, i do not blame windows support topics on why swift is seeing less fraction in server space or outside apple ecosystem - that is just a factor i would personally consider, and one of the more prominently standing out differences if i had to compare it to say go or rust, because it’s otherwise a very solid language i don’t have any meaningful punches to throw at

VikingofRock
Aug 24, 2008




For tree-like structures with parent pointers in Rust, has anyone here tried just throwing everything into a slotmap? That's my plan if I ever run into this problem, so I'm curious what other people's experience with it is.

gonadic io
Feb 16, 2011

>>=
When I did this I just boxed all children haskell style and it was "fine". Probably the most ergonomic if you don't care about speed that much and don't need to mutate much (too much Option<Box<Child>> would get real annoying fast)

brand engager
Mar 23, 2011

Does apple have a patent on that "if let etcetc = whatever then { code block } else { other block }" syntax? I really wish kotlin would steal it and some other nice stuff I'm probably forgetting

gonadic io
Feb 16, 2011

>>=

brand engager posted:

Does apple have a patent on that "if let etcetc = whatever then { code block } else { other block }" syntax? I really wish kotlin would steal it and some other nice stuff I'm probably forgetting

absolutely not lol, just off the top of my head rust and haskell have exactly this syntax
e: ignore the second half, misread

ErrorInvalidUser
Aug 23, 2021

by Jeffrey of YOSPOS
a patent on syntax

gonadic io
Feb 16, 2011

>>=

ErrorInvalidUser posted:

a patent on syntax

I have confidence this hellworld will produce it at some point

Xarn
Jun 26, 2015
It would somehow be less surprising than the ui patents Apple got itself

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
hilariously, i am a co-inventor on a patent on the entire language, taken as a whole. us patent 9,329,844. i'm pretty sure it means absolutely nothing, especially since it's immediately granted under the apache license to anyone who uses the project

Soricidus
Oct 21, 2010
freedom-hating statist shill

cinci zoo sniper posted:

go is basically a faster python

people say this a lot and idgi

code:
def VeryPythonicCode(butts, dongs):
    result, err = insert(dongs, butts)
    if err is not None:
        print(“thank god we fixed error handling at last”)
        return err
    …

akadajet
Sep 14, 2003

mystes posted:

Swift seems perfectly good but it also doesn't seem like it's gotten enough traction outside of the apple ecosystem to be appealing right now for no particular fault of its own.

Oh also I forgot kotlin, lol.

man if apple went for .net instead of doing their own thing it would have owned. fantasy world, I know

Soricidus
Oct 21, 2010
freedom-hating statist shill

ErrorInvalidUser posted:

a patent on syntax

so like the IsNot patent microsoft applied for about 20 years ago?

e: https://patents.google.com/patent/US20040230959A1/en lmao

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=

rjmccall posted:

hilariously, i am a co-inventor on a patent on the entire language, taken as a whole. us patent 9,329,844. i'm pretty sure it means absolutely nothing, especially since it's immediately granted under the apache license to anyone who uses the project

lol you weren't kidding huh

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply