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
cowboy beepboop
Feb 24, 2001

NihilCredo posted:

elm is the best learning language for the same reasons that make it a bitch of a 9-5 language:

- it will force you to write code in exactly one design: purely functional mvu. there is no issue with choosing a framework, because there are no frameworks. anything but the default architecture will not compile. makes python look like perl in that regard

- it will absolutely never let you take any shortcut. every time your data models are poorly designed, the compiler will punish you by forcing you to handle corner cases you don't care about, until you learn to write tighter models with fewer possible states

- it will never provide you with any form of hidden compiler magic, including reflection. you can codegen some trivial stuff like json decoding, but every line of elm code you write you will understand exactly what it does

- it has a bus factor of 1 which is 1 higher than a learning language strictly needs

what is a bus factor

Adbot
ADBOT LOVES YOU

VikingofRock
Aug 24, 2008




my stepdads beer posted:

what is a bus factor

it's how many people need to be hit by a bus before the project falls apart

redleader
Aug 18, 2005

Engage according to operational parameters
elm is also good because there's no chance you'll end up using it in production

mystes
May 31, 2006

Everyone who thinks that "opinionated" is a good thing should have to use Elm.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

DELETE CASCADE posted:

I mean compilers are basically a solved problem so why don’t you just let me write whatever I want and then you optimize it for me magically :colbert:

because type checking / sat solving is hard!

https://forums.swift.org/t/boolean-comparison-causes-extremely-slow-compilation/41609

at least, doing it quickly is hard

cowboy beepboop
Feb 24, 2001

VikingofRock posted:

it's how many people need to be hit by a bus before the project falls apart

oh, lol. nice

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

what’s the term for “number of people who need to be hit by a bus before the project is successful”?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
agile consultant factor

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

it's never happened so it doesn't need a name

epitaph
Dec 31, 2008

Subjunctive posted:

what’s the term for “number of people who need to be hit by a bus before the project is successful”?

enterprise factor

Carthag Tuek
Oct 15, 2005

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



VikingofRock posted:

it's how many people need to be hit by a bus before the project falls apart

irrelevant

Subjunctive posted:

what’s the term for “number of people who need to be hit by a bus before the project is successful”?

irrelevant

the number that counts is whatever the gently caress who cares just get the money first

Xarn
Jun 26, 2015

Subjunctive posted:

because type checking / sat solving is hard!

https://forums.swift.org/t/boolean-comparison-causes-extremely-slow-compilation/41609

at least, doing it quickly is hard

quote:

Bool and Bool.==, like all fundamental types, are defined in the standard library and not built into the compiler. The ideal is that anything required to design these fundamental types should be available to everyone.

Because it was suuuuuch a good idea when C++ started doing this.

Fortaleza
Feb 21, 2008

Subjunctive posted:

what’s the term for “number of people who need to be hit by a bus before the project is successful”?

The Ballmer Coefficient

RPATDO_LAMD
Mar 22, 2013

🐘🪠🍆
as far as I know there is no special term for "number of programmers"

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Xarn posted:

Because it was suuuuuch a good idea when C++ started doing this.

our constraint solver is extremely slow about some of this stuff and i don't understand why at all

Xarn
Jun 26, 2015
:shrug:

I do a lot of work with sats and csps, but I am not interested enough in Swift to take a look at what exactly you are doing.

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

RPATDO_LAMD posted:

as far as I know there is no special term for "number of programmers"
a repository?

Carthag Tuek
Oct 15, 2005

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



RPATDO_LAMD posted:

as far as I know there is no special term for "number of programmers"

it's a term of art. definitions vary but basically it means how many can you see from here

Bourricot
Aug 7, 2016



Cybernetic Vermin posted:

i think sml and racket are the places to look at here. sml as the easy intro to cooler type systems, racket as the look at lisps, to take a look at the cool stuff people get up to with dsl's in a context where they are very natural (e.g. stuff like miniKanren)
A while ago, this topic recommended the Dan Grossman MOOC and it uses both SML and Racket to give you a deeper understanding of programming languages. As someone who had only experience with imperative programming, it was pretty eye-opening.

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen

RPATDO_LAMD posted:

as far as I know there is no special term for "number of programmers"

you take some devs and some tech
and you jam 'em all together
you get a buggy poo poo stack
a buggy poo poo stack

Cybernetic Vermin
Apr 18, 2005

Xarn posted:

Because it was suuuuuch a good idea when C++ started doing this.

yeah, swift is overall very sensibly designed, but the moment you say "well, you see, the expression 'x==false' could mean so many different things that it is a computationally hard problem to figure it out" you for sure have made a very severe mistake along the line (and not just because it makes your compiler difficult to implement).

mystes
May 31, 2006

Sagacity posted:

a repository?
The correct term is a stench of programmers.

Athas
Aug 6, 2007

fuck that joker

Plorkyeran posted:

sml is my favorite programming language that i do not expect to ever use again

SML is an industrial strength language with a package manager and literally over half a dozen packages for everything you could possibly need. Migrate all your code to SML today!

havelock
Jan 20, 2004

IGNORE ME
Soiled Meat
Definitely SML and a LISP like (SICP with scheme?)

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

animist posted:

ty, makes sense.

trying to decide whether I should bring llvm into my toy project or just generate lovely code by hand. i'll prolly do it by hand, seems more fun

IMO using LLVM is a lot of fun just because it lets you focus on your desired semantics and can produce state-of-the-art high performance output with relatively little effort. Plus then you'll be better prepared to work on any number of real world compiler projects that use it.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Ralith posted:

IMO using LLVM is a lot of fun just because it lets you focus on your desired semantics and can produce state-of-the-art high performance output with relatively little effort. Plus then you'll be better prepared to work on any number of real world compiler projects that use it.

initially implementing code generation "by hand" is a lot of fun IME because going from some hex numbers in your source code to the processor doing a thing for you is a magical experience. all the work you have to do after that to refactor and extend and rewrite and chase dumb edge cases a million times as your use of the generator grows in complexity...that's a lot less fun. were it me I would probably do initial codegen by hand to get something basic up and running (and lick that bare-metal-coding toad), and then use it to generate some regression tests I could work with while implementing the LLVM backend

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.
Pretty sure the term for a group of programmers is 'a hive', since that's where all the bugs are made.

CPColin
Sep 9, 2003

Big ol' smile.
Or a "colony", because of all the white or Indian people (and the bugs)

mystes
May 31, 2006

CPColin posted:

Or a "colony", because of all the white or Indian people (and the bugs)
That doesn't sound like a great direction to go in.

CPColin
Sep 9, 2003

Big ol' smile.
Go back in time and tell that to Europe!!

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
To be fair, we *did* try to go west instead.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Cybernetic Vermin posted:

yeah, swift is overall very sensibly designed, but the moment you say "well, you see, the expression 'x==false' could mean so many different things that it is a computationally hard problem to figure it out" you for sure have made a very severe mistake along the line (and not just because it makes your compiler difficult to implement).
well at least you don't run the risk of executing unreachable code

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?

Bored Online posted:

if im gonna waste my weekend learning a functional lang which one should it be. does it even matter at that point?

prolog

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?

animist posted:

ty, makes sense.

trying to decide whether I should bring llvm into my toy project or just generate lovely code by hand. i'll prolly do it by hand, seems more fun

llvm because then you can target pretty much anything with your toy language and easily experiment with optimization and such

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?

Carthag Tuek posted:

nothing matters

mattering involves state and we can’t have that

Zaxxon
Feb 14, 2004

Wir Tanzen Mekanik

redleader posted:

elm is also good because there's no chance you'll end up using it in production

I worked at a place that used elm in production, and I'll tell you, you can pretty easily write lovely impossible states, and get run-time errors you didn't intend I mean it's harder than JS but you can still get them. It's still ok though, I wouldn't use it again because I hate a lot of the aesthetics of it.

like the whole "put the comma on the start of the new line" poo poo.

havelock
Jan 20, 2004

IGNORE ME
Soiled Meat
I sat next to some core elm folks at a conference a while back and was trying to ask how you did components since a big match expression thing for the discriminated union on messages isn't extensible by design and the answer was that I didn't want that, but they couldn't explain why (or I didn't know enough to get it). Some notion of private state for a ui seems awfully important to avoid having to build up stuff from primitives in every single app.

There has to be a way to reconcile this, right? Types are great and I love em, but I also love composition.

mystes
May 31, 2006

havelock posted:

I sat next to some core elm folks at a conference a while back and was trying to ask how you did components since a big match expression thing for the discriminated union on messages isn't extensible by design and the answer was that I didn't want that, but they couldn't explain why (or I didn't know enough to get it). Some notion of private state for a ui seems awfully important to avoid having to build up stuff from primitives in every single app.

There has to be a way to reconcile this, right? Types are great and I love em, but I also love composition.
This is a common complaint and if you look at the elm style frameworks in haskell/purescript, most of them try to allow you to make things more composable in some way, but some of the approaches can get significantly more complicated to understand.

In particular, the ones that try to be almost exactly like elm but do complicated monadic stuff to have local state seem to be superficially easy but then get really complicated once you need to access state from parent elements or vice versa. Halogen, which seems to be the most popular purescript framework, allows you to explicitly break stuff up into components in a way that seems like it might be a better compromise.

However, once you start getting into any of this stuff it seems like it eliminates the simplicity that's arguably the whole draw of the MVU approach in the first place.

mystes fucked around with this message at 15:19 on Nov 15, 2020

Zaxxon
Feb 14, 2004

Wir Tanzen Mekanik

havelock posted:

I sat next to some core elm folks at a conference a while back and was trying to ask how you did components since a big match expression thing for the discriminated union on messages isn't extensible by design and the answer was that I didn't want that, but they couldn't explain why (or I didn't know enough to get it). Some notion of private state for a ui seems awfully important to avoid having to build up stuff from primitives in every single app.

There has to be a way to reconcile this, right? Types are great and I love em, but I also love composition.

I'm not sure if I'm interpreting your question right, but in practice you just hide everything behind modules and don't import much other than the message type declaration and update functions. So you just end up writing code for the state at the level you are at in the tree, everything else just gets passed down to the component. So while technically the state isn't private. You simply don't ever gently caress around with it except through update functions.

people do end up kinda breaking this a lot though, because you often want components to "talk" to each other in two directions and the framework as written doesn't really allow that, so you have to either make all your update functions pass return messages along with their state changes, which means you have to wrap up any component that doesn't do that by default, or re-write all components to work that way meaning they now don't really work right with pages that don't need backwards messaging, poo poo like that.

Zaxxon fucked around with this message at 20:12 on Nov 15, 2020

Adbot
ADBOT LOVES YOU

NihilCredo
Jun 6, 2011

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

one big model with all state + one big match expression with a big DU of every possible message is in fact exactly what you want because it's very, very, very easy for a formerly isolated component to suddenly start showing some information located somewhere else, or to suddently start sending messages you used to have to go somewhere else to do

e.g. you start with two pages, Contacts and Chats. they are isolated and only access their part of the model, and can only send their specific type of message.

then you want to add a popup notification for new chats while you're in the Contacts page - whoops, now the page needs to access the Chats part of the model as well!

then you want to be able to type out a quick reply from a textbox inside the popup notification - whoops, now the Contacts page needs to be able to send a ChatReply message as well!

if you want to keep them OO-style isolated (ie totally unaware of each other), you end up with different messages based on whether the reply was typed from the full Chat page or from Contacts - which makes no sense and will only complicate things, because it's the same data, just displayed in a different view

that doesn't mean you have to keep 3k-line long update and view functions, of course. constantly break that poo poo up as it grows. eliminate repetitions super aggressively. you're enduring all the anal retentiveness of elm for the sake of getting safe and easy refactors, take advantage of it

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