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
fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

FamDav posted:

i like that jvm has a gay rear end c++, a gay rear end ml, and a gay rear end lisp now.

scala, ????, and clojure. whats the gay rear end ml

Adbot
ADBOT LOVES YOU

Notorious b.s.d.
Jan 25, 2003

by Reene
to put it another way, there is a fork in the road:
  • if you are committed to being C#-compatible, you will spend your dev time chasing whatever microsoft thinks is a good idea

  • if you are not committed to being C#-compatible, you do whatever the gently caress you want. that brought us scala and groovy.

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

unless you mean java itself is the gay rear end c++, and scala is the gay rear end ml

FamDav
Mar 29, 2008

MeramJert posted:

unless you mean java itself is the gay rear end c++, and scala is the gay rear end ml

yar, though honestly i know nothing about scala. should i? is scala more c++ than ml?

teach me

touch me

Sapozhnik
Jan 2, 2005

Nap Ghost

not yet it doesn't

also wake me up when java 8 has properties because getter/setter boilerplate is so tedious that i use naked data members for classes that are literally just dumb tuples with no methods on them

try it sometime, it's liberating.

Notorious b.s.d.
Jan 25, 2003

by Reene

Mr Dog posted:

not yet it doesn't

also wake me up when java 8 has properties because getter/setter boilerplate is so tedious that i use naked data members for classes that are literally just dumb tuples with no methods on them

try it sometime, it's liberating.

scala has everything you just wanted
  • properties on regular classes

  • dumb tuples with no methods -- even a literal syntax to define on the fly

  • "case classes" -- shorthand to define classes so simple/dumb they are just structs

edit: also all these things interoperate with regular java, so if a scala class produces a tuple or something as a return value, that will not be a pain in your teammates' balls

Notorious b.s.d.
Jan 25, 2003

by Reene
it's almost as if thinking people sat down and considered what a more powerful java-like language would look like, then worked on implementing their ideas

gonadic io
Feb 16, 2011

>>=
when I had to be in .net I used F# and it was okay. I guess I'll try scala if I'm ever on the jvm

Notorious b.s.d.
Jan 25, 2003

by Reene

AlsoD posted:

when I had to be in .net I used F# and it was okay. I guess I'll try scala if I'm ever on the jvm

one of the great things about scala vis a vis F# is that even if you never, ever touch any of the FP stuff, it is still a useful improvement over java

the syntax is extremely similar to java, but a repl, type inference, and improved collections/primitives are super great even if you never want to get functional

i'm not sure anyone would ever work in F# unless they explicitly wanted F#'s FP stuff. (this might be true only because C# has moved forward a lot faster than java)

Sapozhnik
Jan 2, 2005

Nap Ghost
eugh, no.

If you want to create a new language, create a new freestanding language, don't build one on top of the Indian burial ground that is the JVM and Java class library. Can you really tell me that the constraints of the JVM had no effect on Scala's design? I seem to recall something about reams and reams of generated interfaces.

I know it's easier said than done since the JVM is the product of 10 solid years of R&D into the best managed VM ever created, but jeez couldn't they have done it on top of LLVM or something? at least that one doesn't come with a huge class library that has Opinions.

poo poo, Ruby and Python just use bytecode interpreters and it seems to work out ok for them.

gonadic io
Feb 16, 2011

>>=

Notorious b.s.d. posted:

i'm not sure anyone would ever work in F# unless they explicitly wanted F#'s FP stuff.

i'm pretty sure this is correct.

the trouble is though that a lot of the fp stuff is compiler related. does scala have tail call recursion? What about pure-code related optimisations like being really aggressive with constant folding and immutable collections and stuff?

raminasi
Jan 25, 2005

a last drink with no ice

Notorious b.s.d. posted:

one of the great things about scala vis a vis F# is that even if you never, ever touch any of the FP stuff, it is still a useful improvement over java

the syntax is extremely similar to java, but a repl, type inference, and improved collections/primitives are super great even if you never want to get functional

i'm not sure anyone would ever work in F# unless they explicitly wanted F#'s FP stuff. (this might be true only because C# has moved forward a lot faster than java)

yeah a lot of the good stuff from f# leaks into c#. algebraic data types probably never will though :(

Notorious b.s.d.
Jan 25, 2003

by Reene

AlsoD posted:

the trouble is though that a lot of the fp stuff is compiler related. does scala have tail call recursion? What about pure-code related optimisations like being really aggressive with constant folding and immutable collections and stuff?

scala has a really fuckin fancy pants compiler. it has to, in order to work at all.

it supports some very limited TCO. (the jvm doesn't have a working longjmp/goto instruction at the bytecode level, so nothing beyond very simple local TCO is even possible.)

coming from java, scala's collections library is a thing of wonder.
  • there is a set of basic types describing behaviour. (see chart)

  • for each basic type, there is at leas one mutable and one immutable implementation sharing the interface

  • the concrete implementations can be converted to parallelized types easily. "collection.map(foo)" is single-threaded. "collection.par.map(foo)" converts the collection and runs the map in parallel.


HORATIO HORNBLOWER
Sep 21, 2002

no ambition,
no talent,
no chance
two words i loving hate: entity and role. ban these words forever please

MononcQc
May 29, 2007

I want to put arbitrary bans on words like 'data', 'object', and 'thing' in code discussions and see how quickly the conversation grinds to a halt.

Notorious b.s.d.
Jan 25, 2003

by Reene

MononcQc posted:

I want to put arbitrary bans on words like 'data', 'object', and 'thing' in code discussions and see how quickly the conversation grinds to a halt.

"ok, this is simple. when Alice frobs the fizzbat held by Bob, Charlie's whatsit will grok the updated fizzbat status, alright?"

jargon is better than nothing.

gonadic io
Feb 16, 2011

>>=

MononcQc posted:

I want to put arbitrary bans on words like 'data', 'object', and 'thing' in code discussions and see how quickly the conversation grinds to a halt.

what about if i make it clear that i'm talking about the data keyword?

Notorious b.s.d.
Jan 25, 2003

by Reene

AlsoD posted:

what about if i make it clear that i'm talking about the data keyword?

we'll deprecate it and replace it with a unary $$..> operator

then the forbidden words can go in peace and people can try and explain "double dollar sign double dot gee tee" annotations

MeruFM
Jul 27, 2010

MononcQc posted:

I want to put arbitrary bans on words like 'data', 'object', and 'thing' in code discussions and see how quickly the conversation grinds to a halt.

you prefer people using the structure type?

Bio and chem have long names up the rear end deep into the colon. Now there's a billion acronyms and it's almost impossible for anyone to join the conversation until you read at least 2-3 landmark papers on the subject. And it's still not a good bullshit filter because anyone with half a brain can memorize acronyms, see HR and recruitment.

MononcQc
May 29, 2007

If we can't bother being able to name the poo poo we're using in a conversation properly instead of using overly vague keywords, we shouldn't expect our audience/interlocutors to get a decent understanding of the meaning we carried, at least without examples or further indications to help clarify the intent behind said keybuzzwords we used :colbert:

FamDav
Mar 29, 2008

MononcQc posted:

If we can't bother being able to name the poo poo we're using in a conversation properly instead of using overly vague keywords, we shouldn't expect our audience/interlocutors to get a decent understanding of the meaning we carried, at least without examples or further indications to help clarify the intent behind said keybuzzwords we used :colbert:

suck my dick canuck bitch

FamDav
Mar 29, 2008
actually i like being explicit better this is fun tia

Damiya
Jul 3, 2012
Scala owns and is a blast to write and poo poo like implicit classes rules and implicits rule.

:getin:

MononcQc
May 29, 2007

FamDav posted:

suck my dick canuck bitch

I won't play into your fantasies, sorry.

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

FamDav posted:

yar, though honestly i know nothing about scala. should i? is scala more c++ than ml?

teach me

touch me

idk i thought you were making a reference to the hugeness of scala. i don't think scala's really like ml though. like it clearly has been influenced by ml to some degree, but everything seems way more java. this is the type signature for map:
code:
def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That
and you dont actually need to touch any fp stuff at all and can use it as just a better java.

although i guess there's scalaz, which i never used but seems like a library for people that really cant cope with scala not being an ml

gonadic io
Feb 16, 2011

>>=

MeramJert posted:

although i guess there's scalaz, which i never used but seems like a library for people that really cant cope with scala not being an ml

code:
Apply[Option].apply2(some(1), some(2))((a, b) => a + b)
:barf:

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

AlsoD posted:

code:
Apply[Option].apply2(some(1), some(2))((a, b) => a + b)
:barf:

welp,

echinopsis
Apr 13, 2004

by Fluffdaddy
god u guys talk some gibberish at times

Damiya
Jul 3, 2012
Scalaz is scary.

We don't go there.

Mostly we just do some map stuff and a lil bit of implicit references and pass some first class functions around.

It's better that way.

HORATIO HORNBLOWER
Sep 21, 2002

no ambition,
no talent,
no chance

MononcQc posted:

If we can't bother being able to name the poo poo we're using in a conversation properly instead of using overly vague keywords, we shouldn't expect our audience/interlocutors to get a decent understanding of the meaning we carried, at least without examples or further indications to help clarify the intent behind said keybuzzwords we used :colbert:

right on man right on

MononcQc
May 29, 2007

you need to have data to prove the things you object to :smuggo:

Notorious b.s.d.
Jan 25, 2003

by Reene
i warned you guys the type signatures got ugly

MeruFM
Jul 27, 2010

MononcQc posted:

If we can't bother being able to name the poo poo we're using in a conversation properly instead of using overly vague keywords, we shouldn't expect our audience/interlocutors to get a decent understanding of the meaning we carried, at least without examples or further indications to help clarify the intent behind said keybuzzwords we used :colbert:

I'll take good distinct examples over more precise jargon.

Or jargon that doesn't have ambiguities.

Nomnom Cookie
Aug 30, 2009



i like java better than scala. but at least scala doesn't have to do a hash lookup just to find a variable so it's miles better than a p-lang

Innocent Bystander
May 8, 2007
Born in the LOLbarn.
if you were a langauge what would you put in your toy box?

FamDav
Mar 29, 2008
whole lotta dicks

Innocent Bystander
May 8, 2007
Born in the LOLbarn.
IF YOU WERE A LANGUAGE!

Damiya
Jul 3, 2012
I just wrote some code that uses the |>> operator and some other code that uses |>>> and &>>

You're welcome Notorious B.S.D.

motedek
Oct 9, 2012
is there an ide to write all the scala boilerplate? i'm curious about it but gently caress if i'm going to write stuff like this:

MeramJert posted:

code:
def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That

Adbot
ADBOT LOVES YOU

Nomnom Cookie
Aug 30, 2009



motedek posted:

is there an ide to write all the scala boilerplate? i'm curious about it but gently caress if i'm going to write stuff like this:

you're starting to see why i prefer java

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