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
rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
yes, but it's pronounced "clang", don't worry

Adbot
ADBOT LOVES YOU

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
Well, hot on the heels of Microsoft's plang announcement Martin Odersky has some good ideas for improving Scala as well. God bless.

JawnV6
Jul 4, 2004

So hot ...
clang clang clang went the trolley,

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
bing bing bing went the bell

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
flang flang flang is for fortran

Uncle Enzo
Apr 28, 2008

I always wanted to be a Wizard
and for monads you all use haskell

VikingofRock
Aug 24, 2008




JawnV6 posted:

clang clang clang went the trolley,

Wheany posted:

bing bing bing went the bell

pokeyman posted:

flang flang flang is for fortran

Uncle Enzo posted:

and for monads you all use haskell

akadajet
Sep 14, 2003


:toot:

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'


5

Max Facetime
Apr 18, 2009

Sagacity posted:

Well, hot on the heels of Microsoft's plang announcement Martin Odersky has some good ideas for improving Scala as well. God bless.



Will this work?
code:

if                                                          if ({
    println("checking...")                                    println("checking...")
    var j = i + 1                                             var j = i + 1
    j < 10                                                    j < 10
do                                                          }) {
    println("small")                                          println("small")
    1                                                         1
else                                                        } else {
    println("big")                                            println("big")
    100                                                       100
I think it should, for symmetry




i may have messed up the indentation when copy-pasting, apologies

Zemyla
Aug 6, 2008

I'll take her off your hands. Pleasure doing business with you!

Max Facetime posted:

Will this work?
code:
if                                                          if ({
    println("checking...")                                    println("checking...")
    var j = i + 1                                             var j = i + 1
    j < 10                                                    j < 10
do                                                          }) {
    println("small")                                          println("small")
    1                                                         1
else                                                        } else {
    println("big")                                            println("big")
    100                                                       100
I think it should, for symmetry




i may have messed up the indentation when copy-pasting, apologies

I half-imagined that the "code in two columns" thing was for concurrency. :v:

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

Zemyla posted:

I half-imagined that the "code in two columns" thing was for concurrency. :v:

http://www.linusakesson.net/scene/bitbanger/index.php

Max Facetime
Apr 18, 2009

Zemyla posted:

I half-imagined that the "code in two columns" thing was for concurrency. :v:

omg there's two columns in that code when I rotate this phone sideways :whoptc::suicide101:

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
what's a good scala book or tutorial

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

cis autodrag posted:

what's a good scala book or tutorial

I used https://www.manning.com/books/functional-programming-in-scala which got me far enough to start doing things on my own.

e: also this is more intermediate but not a bad place to jump in once you've gotten past the basics.

http://danielwestheide.com/blog/2012/11/21/the-neophytes-guide-to-scala-part-1-extractors.html

DONT THREAD ON ME fucked around with this message at 05:09 on Jun 1, 2017

Corla Plankun
May 8, 2007

improve the lives of everyone

cis autodrag posted:

what's a good scala book or tutorial

its not a book but most of my scala coworkers took Odersky's "Functional Programming Principles in Scala" course on coursera before they started working with it

9-Volt Assault
Jan 27, 2007

Beter twee tetten in de hand dan tien op de vlucht.

cis autodrag posted:

what's a good scala book or tutorial

Here are a bunch of books that just became free: http://underscore.io/books/

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

someone who is in to languages tell me if this is bad or good, thanks

https://danluu.com/empirical-pl/

Arcsech
Aug 5, 2008

Thermopyle posted:

someone who is in to languages tell me if this is bad or good, thanks

https://danluu.com/empirical-pl/

haven't read the article yet but Dan Luu is a heckin smart guy so it's probably not total garbage at least

BobHoward
Feb 13, 2012

The only thing white people deserve is a bullet to their empty skull

Arcsech posted:

haven't read the article yet but Dan Luu is a heckin smart guy so it's probably not total garbage at least

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
refactoring code in an untyped language is a garbage experience that involves creating new code paths because you're afraid to change existing code paths lest it break existing code. but this works just fine for a year or two and produces reasonable looking code.

after a few years of this practice you have a garbage heap.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
the only thing untyped languages are better for is dealing with system boundaries.

but actually it sucks because now instead of things blowing up at the boundary like they should, they blow up deep inside your code where someone forgot to include the same type / null check boiler plate that is included in every single stupid method in your system

DONT THREAD ON ME fucked around with this message at 03:17 on Jun 17, 2017

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
"hey let's wait until runtime to find out if code is broken" -- an insane person

Shaggar
Apr 26, 2006

MALE SHOEGAZE posted:

the only thing dynamic languages are better for is dealing with system boundaries.

but actually it sucks because now instead of things blowing up at the boundary like they should, they blow up deep inside your code where someone forgot to include the same type / null check boiler plate that is included in every single stupid method in your system

yeah the system boundaries of the dumpster they belong in.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i always type 'dynamic' language when i mean 'untyped' langue and it makes me look like a dummy

MononcQc
May 29, 2007

"my view is obviously the correct one", said the yosposter right after being linked to a long report discussing how multiple scientific papers were unable to reasonably prove this very point.

spiritual bypass
Feb 19, 2008

Grimey Drawer
looks like...good programmers do well in whatever language while bad programmers do poorly?

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
every single one of those studies is bullshit involving trivial tasks.

Sapozhnik
Jan 2, 2005

Nap Ghost
everything in programming is driven by fashion and the disciple itself barely pretends to the level of rigor demanded in ornamental carpentry, let alone engineering.

unless we're talking about safety-critical software for nuclear energy and aerospace applications. there we've somehow managed to figure out how to write software that isn't a dumpster fire.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
[quote
Some notable omissions from the studies are comprehensive studies using experienced programmers, let alone studies that have large populations of “good” or “bad” programmers, looking at anything approaching a significant project (in places I’ve worked, a three month project would be considered small, but that’s multiple orders of magnitude larger than any project used in a controlled study),
[/quote]

conclusion: no one has every seriously studied this. therefore, until proven wrong, we can clearly assume typed languages are better than untyped languages for building non-trivial systems.

but untyped langs are still clearly great for other things. like learning or writing simple programs where you can understand every line of code and therefore dont need a type system to help you

DONT THREAD ON ME fucked around with this message at 03:55 on Jun 17, 2017

MononcQc
May 29, 2007

since the study was inconclusive, the radium girls were told there were no occupational hazards, and kept painting watch dials with the "lip, dip, paint" method

MononcQc
May 29, 2007

Here's interesting somewhat unrelated material that still fits into the current context: https://blog.acolyer.org/2017/05/29/an-empirical-study-on-the-correctness-of-formally-verified-distributed-systems/ where researchers compare formally defined distributed systems with widely-used ones that are not formally verified.

quote:

Formally verified systems, and figuring out how to make formal verification accessible and composable are very important building blocks at the most rigorous end of the spectrum.

Fonseca et al. examine three state-of-the-art formally verified implementations of distributed sytems: Iron Fleet, Chapar: Certified causally consistent distributed key-value stores, and Verdi. Does all that hard work on formal verification verify that they actually work in practice? No.

quote:

Through code review and testing, we found a total of 16 bugs, many of which produce serious consequences, including crashing servers, returning incorrect results to clients, and invalidating verification guarantees.



quote:

The unverified systems all contained protocol bugs, whereas none of the formally verified systems did.

[...] the unverified systems chosen “have been tested by innumerable users.” I.e., they’ve been used in the wild by lots of different people in lots of different environments, giving plenty of occasion for all sorts of weird conditions to occur and trip the software up. [...] The formally verified ones have not been battle tested in the same way. And that’s interesting, because when you look at the bugs found in the formally verified systems, they relate to assumptions about the way the environment the system interacts with behaves. Assumptions that turn out not to hold all the time.

[...]

The bugs found by the team fall into three categories. By far the biggest group of bugs relate to assumptions about the behaviour of components that the formally verified system interacts with. These bugs manifest in the interface (or shim layer) between the verified and non-verified components.

This is interesting in the current context of "edge of the system bugs". Also some of the bugs are hilarious:

quote:

  • The Verdi server wrongly assumed that the recv system call would always return an entire request in a single invocation, and failed when given a partial request.
  • Chapar used UDP, but did not handle packet drops because it assumed the network layer was reliable.
  • Verdi used newlines and spaces to distinguish commands and arguments, but did not escape these characters leading to a variety of issues
  • Developers assumed that a single or set of disk operation(s) are atomic during crashes
  •  Buffers too small to handle all possible inputs
  •  Not respecting input size limits in library calls made by the system
And these are developers trying their very best to produce a formally verified and correct system.


Conclusions are reasonable though:

quote:

The answer is not to throw away attempts at formal verification (“we did not find any protocol-level bugs in any of the verified prototypes analyzed, despite such bugs being common even in mature unverified distributed systems“).

[...]

Instead we must recognise that even formal verification can leave gaps and hidden assumptions that need to be teased out and tested, using the full battery of testing techniques at our disposal.

Max Facetime
Apr 18, 2009

Thermopyle posted:

someone who is in to languages tell me if this is bad or good, thanks

https://danluu.com/empirical-pl/

the variables were artificially named such that there was no type information encoded in any of the names, that there were no comments, and that there was zero documentation on the APIs provided. That’s an unusually hostile environment to find bugs in

:allears::allears::allears:

Brain Candy
May 18, 2006

MononcQc posted:

"my view is obviously the correct one", said the yosposter right after being linked to a long report discussing how multiple scientific papers were unable to reasonably prove this very point.

otoh, the idea that science is the only way to know things is a mind poison

Workaday Wizard
Oct 23, 2009

by Pragmatica

Thermopyle posted:

someone who is in to languages tell me if this is bad or good, thanks

https://danluu.com/empirical-pl/

quote:

The Unexpected Results From A Hardware Design Contest; Cooley, J

...
During the expierment, there were a number of issues that made things easier or harder for some subjects. Overall, Verilog users were affected more negatively than VHDL users. The license server for the Verilog simulator crashed. Also, four of the five VHDL subjects were accidentally given six extra minutes. The author had manuals for the wrong logic family available, and one Verilog user spent 10 minutes reading the wrong manual before giving up and using his intuition. One of the Verilog users noted that they passed the wrong version of their code along to be tested and failed because of that. One of the VHDL users hit a bug in the VHDL simulator.
...

hardware programmers: is this normal?

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Brain Candy posted:

otoh, the idea that science is the only way to know things is a mind poison

what

MononcQc
May 29, 2007

Brain Candy posted:

otoh, the idea that science is the only way to know things is a mind poison

The idea that annoys me is rather that you have definitively more reliable studies regarding things impacting code quality such as organisational structure for one that comes to mind rapidly, than those about static/dynamic typing or TDD (as opposed to just iterative development) for example.

So the thing is that you have a bunch of studies that more clearly highlight what actually matters, but developers keep debating things that do not really do so. It's optimizing whether i++ or ++i is better in that one code loop when the software is choking because all DEBUG logs synchronously go to disk.

MononcQc
May 29, 2007

then again I'm pumping out notes into a book about property-based testing when for the most part all the 'proofs' of their effectiveness are based off commercial whitepapers by people selling tools and services about them

Brain Candy
May 18, 2006

MononcQc posted:

The idea that annoys me is rather that you have definitively more reliable studies regarding things impacting code quality such as organisational structure for one that comes to mind rapidly, than those about static/dynamic typing or TDD (as opposed to just iterative development) for example.

So the thing is that you have a bunch of studies that more clearly highlight what actually matters, but developers keep debating things that do not really do so. It's optimizing whether i++ or ++i is better in that one code loop when the software is choking because all DEBUG logs synchronously go to disk.

it's not just programmers; that sort of error seems to be baked into human cognition. i felt slightly less like an alienated crazy person after i had a name for it:

https://en.wikipedia.org/wiki/Attribute_substitution posted:

Attribute substitution is a psychological process thought to underlie a number of cognitive biases and perceptual illusions. It occurs when an individual has to make a judgment (of a target attribute) that is computationally complex, and instead substitutes a more easily calculated heuristic attribute.[1] This substitution is thought of as taking place in the automatic intuitive judgment system, rather than the more self-aware reflective system. Hence, when someone tries to answer a difficult question, they may actually answer a related but different question, without realizing that a substitution has taken place.[2] This explains why individuals can be unaware of their own biases, and why biases persist even when the subject is made aware of them. It also explains why human judgments often fail to show regression toward the mean.

Adbot
ADBOT LOVES YOU

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Brain Candy posted:

otoh, the idea that science is the only way to know things is a mind poison

lol

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