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
rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome
jesus yeah I don't even come close to caring about this poo poo

Adbot
ADBOT LOVES YOU

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome
I'm glad someone does though

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

JewKiller 3000 posted:

here you go then:

if a person does not understand hindley-milner type inference, that is a valid reason to tell him to choose another career path. i'm serious, if you cannot grok a simple unification algorithm that basically boils down to "the caller must be consistent with the callee", you belong as far away from source code as society can possibly place you

programming doesn't have to be a career path, it's also used by people who want to automate a boring part of their actual job

it shouldn't be some high priesthood of types and inference, sometimes people just want to mangle some csvs or screen scrape a web site

JewKiller 3000
Nov 28, 2006

by Lowtax
well harper is an academic, so if your response is of the form "yes that's TECHNICALLY true but it's still a pain in the rear end in the programming language my boss lets me use", i doubt he cares.

there are people out there whose job is to think beyond what is allowed by php and java, and we need these people! :)

MononcQc
May 29, 2007

JewKiller 3000 posted:

basically i think harper is arguing that, since a language like haskell can be made "dynamically typed" when necessary as you describe, but in addition it also supports other static types, there is no reason to use so-called dynamic languages where the unitype is the only one available

But then the opposite idea is also true (see the list of optional typing systems I've posted on last page). You can turn dynamic languages -- at least some of them -- into static ones if you want. It's just a question of where you run the type checking, and if it's blocking compilation or not.

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome

JewKiller 3000 posted:

well harper is an academic, so if your response is of the form "yes that's TECHNICALLY true but it's still a pain in the rear end in the programming language my boss lets me use", i doubt he cares.

there are people out there whose job is to think beyond what is allowed by php and java, and we need these people! :)

I'm not so sure about that last part.

Catalyst-proof
May 11, 2011

better waste some time with you

JewKiller 3000 posted:

well harper is an academic, so if your response is of the form "yes that's TECHNICALLY true but it's still a pain in the rear end in the programming language my boss lets me use", i doubt he cares.

there are people out there whose job is to think beyond what is allowed by php and java, and we need these people! :)

you made the mistake of thinking anyone here actually wants to discuss programming languages in the programming language thread

near as i can tell this thread is about posting braindead contrarian bullshit over and over

JewKiller 3000
Nov 28, 2006

by Lowtax

Cocoa Crispies posted:

programming doesn't have to be a career path, it's also used by people who want to automate a boring part of their actual job

it shouldn't be some high priesthood of types and inference, sometimes people just want to mangle some csvs or screen scrape a web site

that's absolutely fine with me, not that anyone needs my permission. to give a silly engineering analogy, if you are building a bridge across the 2 foot wide creek in your backyard, nobody minds if you use old rotting boards and superglue. but if we're talking about the bay bridge, i don't wanna see any loving php

pointers
Sep 4, 2008

just poppin' in to say this was the best thing

https://www.youtube.com/watch?v=0-BxxMp5BRE

JewKiller 3000
Nov 28, 2006

by Lowtax

MononcQc posted:

But then the opposite idea is also true (see the list of optional typing systems I've posted on last page). You can turn dynamic languages -- at least some of them -- into static ones if you want. It's just a question of where you run the type checking, and if it's blocking compilation or not.

i think the key here is the caveat "some of them". there are definitely programs you can write in dynamically typed languages which will not statically type check without a more advanced type system than is tractable to run, if they type check at all. statically type checking dynamic languages is an active research area, but all systems i know of that handle real programs contain a catchall dynamic type to fall back on

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

JewKiller 3000 posted:

that's absolutely fine with me, not that anyone needs my permission. to give a silly engineering analogy, if you are building a bridge across the 2 foot wide creek in your backyard, nobody minds if you use old rotting boards and superglue. but if we're talking about the bay bridge, i don't wanna see any loving php

that's a poo poo analogy though, because one of the nice parts about modern programming is most things scale horizontally to a point, and you can replace parts cheaply and easily

Nomnom Cookie
Aug 30, 2009



advocating usage of h-m languages in production should be a fireable offense imo

Nomnom Cookie
Aug 30, 2009



p langs are ok someone has to do the web janitoring

JewKiller 3000
Nov 28, 2006

by Lowtax

Cocoa Crispies posted:

that's a poo poo analogy though, because one of the nice parts about modern programming is most things scale horizontally to a point, and you can replace parts cheaply and easily

i don't think that's really true. take facebook as an example, they started with some dirty php code, then needed to scale up. to do this, they first spent a shitload of money on hardware. then, when that wouldn't help anymore, they hired some very expensive developers to write a custom compiler (with jit!) from their busted-rear end php to c++. they also hired up all the "decent" php programmers to fix the code so their custom compiler can handle it efficiently. and facebook is still slow and it sucks. none of this sounds cheap or easy.

if you are doing a little basic automation for your job that is not oriented around computers and providing services through them, do it however you want! otherwise i really believe it makes sense to plan for the future

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
i just looked up hindley milner type inference and they're throwing upside down capital A's at me and i just realizd that you're all taking the piss

JewKiller 3000
Nov 28, 2006

by Lowtax
the upside down A means forall, go read the wikipedia page on first order logic, it will take you 10 minutes.

for some reason people present hindley-milner type inference in a much more complicated way than it needs to be presented imo. it's just unification, checking for consistency of types

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
right on thx
i really do enjoy reading about all of this, ive just stayed in the safe domain of boring procedural poo poo so far

abraham linksys
Sep 6, 2010

:darksouls:
clojurescript is terrible but a fun way to get into functional programming. it produces unreadable and un-debugable javascript but could actually be useful if source maps are ever implemented in a comprehensive way

im doing this terrible hybrid functional-ish style right now, since i wrote a dom binding js lib that im using that uses a completely mutable model to set properties and binds on, but i'd like to make some sort of more pleasant interface for dom binding in clojurescript.

anyways you do get to do neat tricks like

code:
(defn parse-moves [moves-string]
  (map js/parseInt
        (-> moves-string
          (replace #"[\s|\[|\]]" "")
          (split ","))))
which is the same as

code:
(defn parse-moves [moves-string]
  (map js/parseInt
       (split (replace moves-string #"[\s|\[|\]]" "") ",")))
the latter is still readable, but i like that you can do almost jquery-style "chaining" by passing a result as the first argument with that -> macro :)

its weird learning the syntax rules though. i guess you should always indent a line to the argument of the call above it? this is from some style guide i found on github:

code:
;; good
(filter even?
        (range 1 10))

;; bad
(filter even?
  (range 1 10))
it's a pain in the rear end in sublime text 2, there must be some sort of way to make tab align that properly, right? or am i going to have to switch text editors for a dumb toy language

and parens management is also hell in sublime text 2, apparently vim and emacs have much better plugins for that ("rainbow parens" so you can have each set a different color sounds brilliant)

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome
but you can already write functional programs in just regular javascript ... ???

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome
i mean there's like nine million perfectly fine ways to write functional programs but no, some shitass has to come along and make a new language because i dont even know why

Nomnom Cookie
Aug 30, 2009



i have to work with a thing written partly in clojure and ugh i hate clojure

JewKiller 3000
Nov 28, 2006

by Lowtax
edit: this post is for jonny 290 :)

assumption for this post: the * operator takes two integers and returns an integer

let's say you have a function square, that takes an argument x and returns x * x

now you want to set the variable y = square 2. what is the type of y? obviously it's int, because square 2 returns int. so why should you have to specify the type of y? just write "let y = square 2" and then use y. the compiler knows y is an int. if you do something with y that is not supported on ints, like string concatenation, you get an error like: "here you used y as a string, but y is an int"

extrapolate that principle to the rest of the programming language. that's literally all there is to it. does this post seem retarded simple??? that's because it is!!!

FamDav
Mar 29, 2008

rotor posted:

but you can already write functional programs in just regular javascript ... ???

and he's not even being a dick.

abraham linksys
Sep 6, 2010

:darksouls:

rotor posted:

i mean there's like nine million perfectly fine ways to write functional programs but no, some shitass has to come along and make a new language because i dont even know why

well clojure makes some sense since it sits on top of the jvm

do agree that whoever decided that it needed a js port was a lunatic, but the neat part is that because it originally was made to interop with java libraries, the same syntax works well for js interop

but yeah you should just write javascript (or even coffeescript, i don't care, that output is perfectly readable and debuggable) unless youre loving around like me

i like having something i sort of know as a basis for proper functional languageness

JewKiller 3000
Nov 28, 2006

by Lowtax

rotor posted:

but you can already write functional programs in just regular javascript ... ???

javascript got closures basically right. unfortunately that is the only thing javascript got right.

the functional programming languages i've enjoyed working with provide a static type system featuring algebraic data types and h-m style type inference

Nomnom Cookie
Aug 30, 2009



clojure's only positive aspect is the jam integration, sooooo...let's take that out

Opinion Haver
Apr 9, 2007

functional programming doesn't seem like it'd be nearly as good without pattern matching

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome

abraham linksys posted:

but the neat part is that because it originally was made to interop with java libraries, the same syntax works well for js interop

you can call java stuff directly from javascript using liveconnect, assuming you have java installed in your browser (lmao)

FamDav
Mar 29, 2008

JewKiller 3000 posted:

the upside down A means forall, go read the wikipedia page on first order logic, it will take you 10 minutes.

for some reason people present hindley-milner type inference in a much more complicated way than it needs to be presented imo. it's just unification, checking for consistency of types


Saying it's forall is a bit of a stretch, it can be best described as a type template.

abraham linksys
Sep 6, 2010

:darksouls:

rotor posted:

you can call java stuff directly from javascript using liveconnect, assuming you have java installed in your browser (lmao)

:stonk:

i'm kind of shocked that i'd never heard about this technology before. obviously there's no real use for it unless you're making lovely korean banking apps (actually, i think those are supposed to be activex), but it sounds legendarily bad

MononcQc
May 29, 2007

JewKiller 3000 posted:

i think the key here is the caveat "some of them". there are definitely programs you can write in dynamically typed languages which will not statically type check without a more advanced type system than is tractable to run, if they type check at all. statically type checking dynamic languages is an active research area, but all systems i know of that handle real programs contain a catchall dynamic type to fall back on

Yeah, there are some obviously uncheckable languages (say, non-strict perl that has been shown to be undecidable).

I think the idea of dynamic languages as a broad group being unityped and thus more restrictive than static languages is not as cleanly defined as Bob would say.

Is the dynamic Haskell less or more (or as) powerful depending on when checks happen? How do you define how powerful a language's optional type system is when it relies on some universal type, but less frequently than another one's? Are they to be considered as the same?

It's tricky stuff, and just saying "eh, it's dynamic and thus unityped :smug:" is a reductionist approach, I think.

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome

abraham linksys posted:

:stonk:

i'm kind of shocked that i'd never heard about this technology before. obviously there's no real use for it unless you're making lovely korean banking apps (actually, i think those are supposed to be activex), but it sounds legendarily bad

it's no different from javascript talking directly to a flash plugin, a video plugin or any other native object exposing an interface.

Nomnom Cookie
Aug 30, 2009



can java call back into js? i want to write a swing web app

default laf and everything

edit: a JS library implementing swing would be sufficient i guess

JewKiller 3000
Nov 28, 2006

by Lowtax

FamDav posted:

Saying it's forall is a bit of a stretch, it can be best described as a type template.

ok i just checked the wikipedia page for hindley-milner and it is hopelessly spergorific for beginners. if the first time someone is hearing the term is this thread, i doubt they will get much from it

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome

Nomnom Cookie posted:

can java call back into js?

yes

FamDav
Mar 29, 2008

JewKiller 3000 posted:

ok i just checked the wikipedia page for hindley-milner and it is hopelessly spergorific for beginners. if the first time someone is hearing the term is this thread, i doubt they will get much from it

Like most wikipedia pages on anything logic-related beyond basic calculus, it's so mired in unexplained, terse terminology that it's incredibly difficult to parse.

Like the first mention of a polytype is here:

quote:

A function with polytype \forall \alpha . \alpha -> \alpha by contrast can map any value of the same type to itself, and the identity function is a value for this type. As another example \forall \alpha . (SET \alpha) -> INT is the type of a function mapping all finite sets to integers. The count of members is a value for this type. Note that qualifiers can only appear top level, i.e. a type \forall \alpha . \alpha -> \forall \alpha . \alpha for instance, is excluded by syntax of types and that monotypes are included in the polytypes, thus a type has the general form blahblahblahblah.

Notice where they do not loving once explain what a polytype is.

EDIT: They also refer to an example 1 that is not inlined. And their use of latex is making GBS threads. f OO does not have to look like that,

FamDav fucked around with this message at 05:49 on Mar 5, 2013

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome
https://developer.mozilla.org/en-US/docs/JavaScript/Guide/LiveConnect_Overview

im tryin to test this stuff to see if it still works but ugh all this clicking

JewKiller 3000
Nov 28, 2006

by Lowtax

MononcQc posted:

Is the dynamic Haskell less or more (or as) powerful depending on when checks happen? How do you define how powerful a language's optional type system is when it relies on some universal type, but less frequently than another one's? Are they to be considered as the same?

here i will diverge from harper's view towards my own, since i'm not qualified to speak for him. i think of power as expressivity. by that definition, dynamic languages are strictly more powerful than static ones, since they can express more programs. however, the goal of language design should not merely be to maximize power in this sense, but to balance power with safety. if your programming language allows you to run programs that are clearly wrong, i don't see that as a feature.

analogously, power in static type systems is defined by the type language's expressive capability. in a dynamically typed programming language, you cannot express anything statically, so on this view you are powerless. in haskell with an optional dynamic type, you can express a great deal statically, with the dynamic fallback if necessary. so i would consider dynamic haskell to be more powerful than e.g. any p-language

JewKiller 3000 fucked around with this message at 05:52 on Mar 5, 2013

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

JewKiller 3000 posted:

i don't think that's really true. take facebook as an example, they started with some dirty php code, then needed to scale up. to do this, they first spent a shitload of money on hardware. then, when that wouldn't help anymore, they hired some very expensive developers to write a custom compiler (with jit!) from their busted-rear end php to c++. they also hired up all the "decent" php programmers to fix the code so their custom compiler can handle it efficiently. and facebook is still slow and it sucks. none of this sounds cheap or easy.

the beginning part where fuckerberg did a thing was cheap and easy, and the riskiest part of the business because it was his time and money

if it wasn't cheap and easy it wouldn't have been done and we'd all be using MySpace or Friendster or Irkutsk or w/e instead and those were way worse than Facebook

Adbot
ADBOT LOVES YOU

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
myspace had a value proposition that wasn't just "you know you want it" ;-*

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