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.
 
  • Locked thread
weird
Jun 4, 2012

by zen death robot

Shaggar posted:

what does "folder1 gcd" mean?

its also curried, equivalent to gcds l = foldr1 gcd l

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006
that's really awful syntax.

also are there any functional examples that aren't pointless exercises like gcd? also lol @ using gcds for the name of ur function thus making everyone assume it should return multiple values.

gonadic io
Feb 16, 2011

>>=

Shaggar posted:

also are there any functional examples that aren't pointless exercises like gcd?

http://bartoszmilewski.com/2014/02/26/c17-i-see-a-monad-in-your-future/


haskell is literally beta-testing c# features so even if you wouldn't program in it i don't see how you can decry it as useless

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Bloody posted:

heres a question: why should i ever give a single gently caress about functional programming and/or how is it relevant to things i give a single gently caress aobut

because side effects are bad (i've been told)

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Shaggar posted:


also are there any functional examples that aren't pointless exercises like gcd?

http://xmonad.org/

BONGHITZ
Jan 1, 1970

but what about objective c?

Bloody
Mar 3, 2013

this sounds completely irrelevant to anything i give a poo poo about, ty

gonadic io
Feb 16, 2011

>>=

Bloody posted:

this sounds completely irrelevant to anything i give a poo poo about, ty

you're in the right thread then

Notorious b.s.d.
Jan 25, 2003

by Reene

Bloody posted:

heres a question: why should i ever give a single gently caress about functional programming and/or how is it relevant to things i give a single gently caress aobut

  • strongly typed fp code is easy to reason about. poo poo almost always does exactly what you expect

  • map/filter/reduce is a really chill and natural way to tackle a shitload of problems. ferinstance like 90% of CRUD webapps

  • imagine never seeing an NPE ever again

  • some things become automatically parallelizable if you write them in an fp style

i find fp interesting but not interesting enough to overcome haskell syntax or haskell library availability

good thing f# and scala and clojure exist

Nomnom Cookie
Aug 30, 2009



dons made a blog post a while back about how par sparks in haskell improved performance by FORTY PERCENT when using 4 threads vs. 1. I'm kinda skeptical about the parallelism fairy dust that FP proponents claim exists inside of pure code

Notorious b.s.d.
Jan 25, 2003

by Reene

Kevin Mitnick P.E. posted:

dons made a blog post a while back about how par sparks in haskell improved performance by FORTY PERCENT when using 4 threads vs. 1. I'm kinda skeptical about the parallelism fairy dust that FP proponents claim exists inside of pure code

it's not fairy dust, it's simple as poo poo

if you have a series of pure functions operating on data, there's no dependency between threads. no locking or anything. just split the work into parcels and merge it again later.

Nomnom Cookie
Aug 30, 2009



except its not that simple or par sparks wouldn't suck poo poo. also haskell just sucks poo poo in general from a perf standpoint, sucking poo poo 8 ways at once isn't really a win

MononcQc
May 29, 2007

I don't think functional is intrinsically superior, but it's a model that meshes a bit better with how I think than OO does, which just never really meshed well with me.

raruler
Oct 5, 2003

“Here lies a toppled god —
His fall was not a small one.
We did but build his pedestal,
A narrow and a tall one.”
did they replace erlang with php for facebook chat or are people just lying to me?

MononcQc
May 29, 2007

raruler posted:

did they replace erlang with php for facebook chat or are people just lying to me?

They wrote the first version in Erlang then went "wait we got tons of C++ people and like 2-3 Erlang devs" so they rewrote it in C++. Then they bought Whatsapp and now they have 30something Erlang guys.

Notorious b.s.d.
Jan 25, 2003

by Reene

Kevin Mitnick P.E. posted:

except its not that simple or par sparks wouldn't suck poo poo.

parallelism doesnt suit every problem

sparks worked, in that he did get a perf increase and he didnt get a race condition or something.. it just wasnt very useful because overhead was high

Bloody
Mar 3, 2013

half of the joke here btw is that f# scala haskell clojure whateverthefuck dont run on msp430s

Notorious b.s.d.
Jan 25, 2003

by Reene

Bloody posted:

half of the joke here btw is that f# scala haskell clojure whateverthefuck dont run on msp430s

functional forth

Bloody
Mar 3, 2013

Notorious b.s.d. posted:

functional forth

there's a couple msp430 forth compilers that self-advertise as being not very good, unstable, and limited to one or two out of the literal hundreds of msp430s

Notorious b.s.d.
Jan 25, 2003

by Reene
forth is so easy to implement i dont think anyone ever distributes a finished version

you just write the forth compiler you need for your current project and then do it again for a new project/platform

Bloody
Mar 3, 2013

sounds bad

raruler
Oct 5, 2003

“Here lies a toppled god —
His fall was not a small one.
We did but build his pedestal,
A narrow and a tall one.”

Bloody posted:

sounds bad

Sung to the tune of "The Flintstones"
Firmware
Open Firmware
It's the appropriate technology,
Features
FCode booting
Hierarchical DevInfo tree.

Hack Forth
Using Emacs on the keys,
Save in
NVRAM if you please.
With your
Open Firmware
You can fix the bugs in no time
Bring the kernel up in no time
We'll have an FCode time!

Nomnom Cookie
Aug 30, 2009



Notorious b.s.d. posted:

parallelism doesnt suit every problem

sparks worked, in that he did get a perf increase and he didnt get a race condition or something.. it just wasnt very useful because overhead was high

so we can parallelize pure code but it won't do any good unless we structure the code for parallelism. now what you have is a little bit of sugar over an implicit thread pool. that's...not thrilling

FEMA summer camp
Jan 22, 2006

hey speaking of terrible programmers I cannot remember the name of the linux pistro by that almost tragically insane chrstian dude that registered on the forums to briefly defend his poor decisions to us bitter, easily amused nerds

so... what was it called again?

i need the information for a project, do not ask wh-I mean, the project is making fun of poor decisions like my posts, etc.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

FEMA summer camp posted:

hey speaking of terrible programmers I cannot remember the name of the linux pistro by that almost tragically insane chrstian dude that registered on the forums to briefly defend his poor decisions to us bitter, easily amused nerds

so... what was it called again?

i need the information for a project, do not ask wh-I mean, the project is making fun of poor decisions like my posts, etc.

http://www.templeos.org/

and he's not 'almost tragically insane' he's just 'tragically insane'

MononcQc
May 29, 2007

Bloody posted:

sounds bad

It's not necessarily that bad. I couldn't do it, but that thing's one way to do it directly in ASM, with lots of docs, and that's 2300 LOCs

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

prefect posted:

there's a difference? :downs:

yes? methods are connected to objects, functions aren't

a cyberpunk goose
May 21, 2007

i will not tolerate forth hate in this thread

forth is god's language and any naysayers will burn in h(ask)ell

Shaggar
Apr 26, 2006

MeramJert posted:

yes? methods are connected to objects, functions aren't

which is why functions are largely useless

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
object-oriented programming: for when you want to pass an agglomeration of random state into every single function but don't want to admit it

a cyberpunk goose
May 21, 2007

MeramJert posted:

yes? methods are connected to objects, functions aren't

functions exist as they are, beautiful flowers of independence

void foo( ) { } is void foo( ) { }

the calling convention is as simple as putting the return address into the LR and jumping to &foo

methods get a bit nastier in that the compiler does more implicit hidden behavior, like an implicit 'this' as a first arg for non-static methods, i'm not a hyper CS wizard but for the most part that's the extent of the differences

MononcQc
May 29, 2007

object1 (ˈɒbdʒɪkt)

1. to express or feel disapproval, dislike, or distaste; be averse.
2. informal a ridiculous or pitiable person, spectacle, etc

Brain Candy
May 18, 2006

AlsoD posted:

you're in the right thread then

until the next context switch :v:

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

raruler posted:

Sung to the tune of "The Flintstones"
Firmware
Open Firmware
It's the appropriate technology,
Features
FCode booting
Hierarchical DevInfo tree.

Hack Forth
Using Emacs on the keys,
Save in
NVRAM if you please.
With your
Open Firmware
You can fix the bugs in no time
Bring the kernel up in no time
We'll have an FCode time!

lol

double sulk
Jul 2, 2010

raruler posted:

Sung to the tune of "The Flintstones"
Firmware
Open Firmware
It's the appropriate technology,
Features
FCode booting
Hierarchical DevInfo tree.

Hack Forth
Using Emacs on the keys,
Save in
NVRAM if you please.
With your
Open Firmware
You can fix the bugs in no time
Bring the kernel up in no time
We'll have an FCode time!

lmao

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Brain Candy
May 18, 2006

Mido posted:

functions exist as they are, beautiful flowers of independence

void foo( ) { } is void foo( ) { }

the calling convention is as simple as putting the return address into the LR and jumping to &foo

methods get a bit nastier in that the compiler does more implicit hidden behavior, like an implicit 'this' as a first arg for non-static methods, i'm not a hyper CS wizard but for the most part that's the extent of the differences

unless you have static state in which your case beautiful galtian functions have another implicit argument of the process

methods as a useful idea take two extra undeclared parameters (currying blah blah), the state of this and the type of this

Nomnom Cookie
Aug 30, 2009



Mido posted:

i will not tolerate forth hate in this thread

forth is god's language and any naysayers will burn in h(ask)ell

god's language is room withstood combinations devised enamoured engaged ftp Incarnation comfortest
delightsome temperance So reached disciple spirits goods placing harmonized
Answer oppose inflicted encumbered lacking bathing precepts changes prize agreed
bringing faintly delight Weight entangled imagining holden betrothed commended
damnable 333

BONGHITZ
Jan 1, 1970

raruler posted:

Sung to the tune of "The Flintstones"
Firmware
Open Firmware
It's the appropriate technology,
Features
FCode booting
Hierarchical DevInfo tree.

Hack Forth
Using Emacs on the keys,
Save in
NVRAM if you please.
With your
Open Firmware
You can fix the bugs in no time
Bring the kernel up in no time
We'll have an FCode time!

Adbot
ADBOT LOVES YOU

Notorious b.s.d.
Jan 25, 2003

by Reene
openfirmware owned

  • Locked thread