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
Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
I'm sure we'd all love to use Haskell, it's just that our code has side effects like "should be useable in the real world"

Adbot
ADBOT LOVES YOU

Ola
Jul 19, 2004

Everyone should know Haskell or common symptoms of Haskell so they can take appropriate measures quickly.

OddObserver
Apr 3, 2009

Ola posted:

Everyone should know Haskell or common symptoms of Haskell so they can take appropriate measures quickly.

If you start exhibiting monads, talk to your doctor immediately?

Ola
Jul 19, 2004

OddObserver posted:

If you start exhibiting monads, talk to your doctor immediately?

Well, it's either Just Haskell, or Nothing.

ryde
Sep 9, 2011

God I love young girls

Sagacity posted:

I'm sure we'd all love to use Haskell, it's just that our code has side effects like "should be useable in the real world"

Must be easily maintainable by a large pool of potential contributors.

Yes we all know good programmers can learn a new language but there’s overhead in doing so.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Athas posted:

Also, you don't need macros for that Joe Blow thing to work with zero overhead. I research language implementation and maintain a compiler, where we implement higher-order functions with defunctionalisation (a 70s technique) to get the same effect (and in contrast to most macro systems, it does not affect type checking).

Yes but have you written a puzzle game played by several thousand people?!

Dr. Stab
Sep 12, 2010
👨🏻‍⚕️🩺🔪🙀😱🙀
lmao john blow's language is hilarious.

quote:

The Jai philosophy is, if you don’t want idiots writing bad code for your project, then don’t hire any idiots


One time a compiler yelled at jon about array bounds and he vowed "Never again should anyone have to suffer this injustice"

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Hammerite posted:

What the gently caress is this post

I don't know or care what the popcorn containers look like at cinemas near me. Why do you have an opinion on something so inane? How does it even occur to you to pay attention to this?

lmao

Xik
Mar 10, 2011

Dinosaur Gum
I'm personally in the pro cardboard box of popcorn camp.

Thermopyle
Jul 1, 2003

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

Hammerite posted:

What the gently caress is this post

I don't know or care what the popcorn containers look like at cinemas near me. Why do you have an opinion on something so inane? How does it even occur to you to pay attention to this?

What the gently caress is this post

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Can someone re-host whatever image was posted? I just get a connection reset error every time. Yes, I tried over an insecure connection, too.

CPColin
Sep 9, 2003

Big ol' smile.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

Thermopyle posted:

What the gently caress is this post

It is a sincere question I asked of Suspicious Dish because I found his post baffling, Thermopyle.

Rereading the post some hours later and taking into account his response to my post, in which he expresses amusement, I am inclined to suppose that my interpretation of his post as sincere was a mistaken one and that he actually intended to suggest that the discussion depicted in the image upon which he was commenting was an inconsequential one.

Xarn
Jun 26, 2015
:hai:

Xerophyte
Mar 17, 2008

This space intentionally left blank

Sagacity posted:

I'm sure we'd all love to use Haskell, it's just that our code has side effects like "should be useable in the real world"

I like Haskell. I wouldn't use it in the real world either, more because it's too niche and very few shops would like to maintain your bespoke Haskell solution to some problem than anything to do with the purity (just use accursedUnutterablePerformIO if you're worried about a lack of side-effects and race conditions). I still think your average programmer should consider learning it -- or really any primarily functional language with a good pattern-matching syntax -- because doing so will (hopefully) teach them a useful way of reasoning about some programming problems.

Personally there's been a decent chunk of stuff I've had to write in C++ around AST and node graph traversals or code in DSL-type data parallelism libraries like Halide that were more natural or at least much briefer to code in Haskell. I still wrote that code in C++, because I have co-workers, but since I'd done similar things in Haskell it was easier to write the verbose C++ equivalent. Also if I'd never written a logo DSL and interpreter in Haskell then I'd never have figured out how to draw Penrose tilings in turtle graphics, and who knows when that'll be critical knowledge for the survival of mankind?

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
the most perplexing thing about that image was the popcorn emoji, i spent far longer on that than i did on the ""horror"" of an extra ternary for readability's sake. if that's the best horror in your codebase you're in good shape there, fellas

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

iospace posted:

Jon blow reminds me of a friend, who works at Google, who is a huge Haskell fan. Like "EVERYONE SHOULD KNOW HASKELL" huge.

haskell doesn't feel close enough to the metal for j blow

Ola
Jul 19, 2004

Xerophyte posted:

or really any primarily functional language with a good pattern-matching syntax

I write Elm at work, it's really nice. Front end is a great place for it. You interact with the real world, but in a very controlled manner. Like the real world is a crazy prisoner and you are handing him stuff through the food port in the cell door.

I still rip on Haskell though, partly to cope with traumas from university.

Thermopyle
Jul 1, 2003

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

Ola posted:

I write Elm at work,

I'm amazed that someone's workplace is good enough to use this for real.

QuarkJets
Sep 8, 2008

Suspicious Dish posted:

the most perplexing thing about that image was the popcorn emoji, i spent far longer on that

So you're a haskell programmer i take it

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen

Ola posted:

Well, it's either Just Haskell, or Nothing.

:lol: Totally stealing this!

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Ola posted:

Well, it's either Just Haskell, or Nothing.

ah, so Maybe Haskell

Absurd Alhazred
Mar 27, 2010

by Athanatos
PYF has a new subforum where people can write threads only they can respond to; kind of like blogging without comments.

Anyway, Jeffrey of YOSPOS started one with his favorite horrible pieces of forums code, which I think you will all appreciate.

spiritual bypass
Feb 19, 2008

Grimey Drawer

Ola posted:

I write Elm at work,

You started your own business?

Ola
Jul 19, 2004

rt4 posted:

You started your own business?

Haha! Is it really that rare? Perhaps it is. It's a normal dev job in a normal company. Elm is fundamentally very solid and it's easier to wrap your head around functional in the specific context of front end. The tooling still has some way to go, if it's so rare as you guys indicate I will probably have to contribute to it myself.

spiritual bypass
Feb 19, 2008

Grimey Drawer
I'm actually running some Elm in production myself in a preposterously overengineered contact form. My experience with other programmers at work is that they simply aren't interested in learning anything challenging, whatever the benefits may be. Sounds like it must be a good job?

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Absurd Alhazred posted:

PYF has a new subforum where people can write threads only they can respond to; kind of like blogging without comments.

Anyway, Jeffrey of YOSPOS started one with his favorite horrible pieces of forums code, which I think you will all appreciate.

You can watch the descent into madness every SA forums programmer makes in real time! Live tweeting Lovecraft horror!

xtal
Jan 9, 2011

by Fluffdaddy

Beef posted:

Coming from Scheme/Lisp, using a macro where a function will do is anathema.

What he shows also looks closer to the grand old compiler-optimization-defying fexpr, not the venerable macro that was designed to replace fexpr.

Or we're giving him too much credit and it's just preprocessor text substitution garbage

The macro/function distinction is different in Scheme because Scheme specifies TCO and so you have some guarantees that your function calls aren't going to blow the stack.

JBlow is a game developer and they approach programming from a completely different perspective that's more rooted in the practical constraints of the language, OS, hardware. A game developer writing C probably does not have good experience with functional programming.

Ola
Jul 19, 2004

rt4 posted:

Sounds like it must be a good job?

It is! Half of this working Friday was an internal conference with the parent and sister companies, 49 talks across 5 stages, then pizza and beer. I think part of the reason we do Elm is that there are some strong personalities with good intentions that say "let's do the good things" and there are managers that say "ok I trust you, just deliver this experience to our customers". I am very happy with my job.

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

Ola posted:

It is! Half of this working Friday was an internal conference with the parent and sister companies, 49 talks across 5 stages, then pizza and beer. I think part of the reason we do Elm is that there are some strong personalities with good intentions that say "let's do the good things" and there are managers that say "ok I trust you, just deliver this experience to our customers". I am very happy with my job.

I get similar reactions when I tell people I work at an Elixir shop. I didn't expect them to be one, either. I didn't have Elixir on my resume, and they didn't mention Elixir in their job listing, but they responded to me based on my Ruby experience and were like, "Uh... what do you think of Elixir?" Now that I'm working there, I'm glad to see they're super dedicated to the Elixir community, including hosting a monthly meetup. It's funny, they've had better luck casting a wide net and hiring programmers who seem capable of learning Elixir than they've had looking for programmers with Elixir experience.

Captain Cappy
Aug 7, 2008

I've written bool ? true : false before, when I wanted the thing to be 1/0 and not a random int someone assigned to the bool (thanks C). Although the promove is !!bool, probably.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Why not just write bool ? 1 : 0 then?

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Captain Cappy posted:

I've written bool ? true : false before, when I wanted the thing to be 1/0 and not a random int someone assigned to the bool (thanks C). Although the promove is !!bool, probably.

This doesn't necessarily work - if you have a bool that doesn't hold a legal bool value, and you try to read it as a bool, you're in undefined behaviourland. The compiler, as always, is allowed to assume that your code does not have any undefined behaviour, and just optimize away your checks.

UraniumAnchor
May 21, 2006

Not a walrus.

Jabor posted:

This doesn't necessarily work - if you have a bool that doesn't hold a legal bool value, and you try to read it as a bool, you're in undefined behaviourland. The compiler, as always, is allowed to assume that your code does not have any undefined behaviour, and just optimize away your checks.

This definitely bit me in the rear end once because the compiler generated code that just flipped the first bit instead of coercing it to 1 or 0. In my defense I didn't write the code that failed to initialize the value, but I was very confused why something wasn't toggling and then discovered that lovely bit of behavior.

Foxfire_
Nov 8, 2010

Captain Cappy posted:

I've written bool ? true : false before, when I wanted the thing to be 1/0 and not a random int someone assigned to the bool (thanks C). Although the promove is !!bool, probably.

Jabor posted:

This doesn't necessarily work - if you have a bool that doesn't hold a legal bool value, and you try to read it as a bool, you're in undefined behaviourland. The compiler, as always, is allowed to assume that your code does not have any undefined behaviour, and just optimize away your checks.

C99 bool aka _Bool normalizes to 0/1 automatically when assigned to (unless your accessing it via a char* alias for some reason).

Beef
Jul 26, 2004
I can confirm that clang cast to bool can force an actual 0 or 1. I just fixed a performance regression where someone trying to do the right thing cost us bit twiddling on every element of a matrix.

Tei
Feb 19, 2011

Man, I love C. Is the spartan of languages. Others languages talk about doing the right thing, C does the right thing.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Tei posted:

Man, I love C. Is the spartan of languages. Others languages talk about doing the right thing, C does the right thing.

This is... not my take on C.

OddObserver
Apr 3, 2009

Phobeste posted:

This is... not my take on C.

Maybe it's a deep argument involving Sparta have been a really lovely place that got heavily mythologized?

Adbot
ADBOT LOVES YOU

Spatial
Nov 15, 2007

C does the wrong thing on purpose without telling you, then blames you for it when you find out

Abusive

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