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
Bloody
Mar 3, 2013

also some papers i skimmed
http://lite.mst.edu/media/research/ctel/documents/LITE-2003-04.pdf
http://www.sciencedirect.com/science/article/pii/S0169814100000251
first one has some relevant sounding refs im strugglin to track down (like LCD legibility under different lighting conditions as a function of character size and contrast)

Adbot
ADBOT LOVES YOU

Nelson MandEULA
Feb 27, 2011

"...the biggest shitbag
I have ever met."
python is pretty great...

Sapozhnik
Jan 2, 2005

Nap Ghost
a dark editing area within a light frame that has light ui elements in it just looks like my text editor has gangrene or something, idk there's just something offputting about it.

very few programs do dark ui in an aesthetically pleasing way. usually they use #FFFFFF text on a dark grey background (which looks awful) when what they need to use a slightly lighter grey for the text, but that's just like the basic poo poo they'd need to get right.

MeruFM
Jul 27, 2010
which is why sublime text is great, too bad it's just a text editor

I tried making intellij look like sublime but ended up with crappy random UI elements that cannot change color, font misalignments, and just general bullshit like crazy highlight colors that don't invert properly.

PleasingFungus
Oct 10, 2012
idiot asshole bitch who should fuck off

Nelson MandEULA posted:

python is pretty great...

nah.

MeruFM
Jul 27, 2010
python is the language we deserve, not the language we want

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
python is pretty great for quickly prototyping an algorithm and then when things get serious 'import numpy' and/or make c code out of it with cython

Tokamak
Dec 22, 2004

Shaggar posted:

C# code:
new[] { "10", "10", "10", "10", "10" }.Select(int.Parse).ToList().ForEach(x=> Console.WriteLine(x+" "+x.GetType()));
:suicide:

has anyone figured out a good way to represent lambdas in traditional brace/block structured languages? or is it practically impossible without significantly overhauling the way a language's compiler parses the code (and making everyone mad)?

b0lt
Apr 29, 2005

Tokamak posted:

has anyone figured out a good way to represent lambdas in traditional brace/block structured languages? or is it practically impossible without significantly overhauling the way a language's compiler parses the code (and making everyone mad)?

scala

weird
Jun 4, 2012

by zen death robot
what's wrong with javascript's lambdas? (I don't write js)

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

apt gangbang posted:

what's wrong with javascript's lambdas? (I don't write js)
js lambdas are js functions, and the biggest problem with js functions is late binding. if you have a function f, then
  • if you call obj.f(), the keyword this will be bound to obj
  • if you call new f(), the keyword this will be bound to a new object.
  • if you call f(), the keyword this will be bound to ~~the global namespace~~
the two important implications are that
  • if you declare a function inside another function and use the outer function as a method, then within the inner function this still refers to the global namespace.
  • if you write a function f() meant to be used as a constructor, using lots of this.prop = val kind of statements, and then accidentally call it without the new keyword, js will silently clobber the global namespace for you.

coffeetable fucked around with this message at 07:42 on Mar 20, 2014

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY
also unrelated but ppl might be interested: epic's new license terms for the Unreal Engine are $20/month and 5% royalties for the full source code

https://www.unrealengine.com/blog/welcome-to-unreal-engine-4

Luigi Thirty
Apr 30, 2006

Emergency confection port.

I literally just got an email bug report from a "samsung subcontractor" in china about how an android app i made 3 years ago on my htc shitbox doesn't work on galaxy s4s

Deus Rex
Mar 5, 2005

Otto Skorzeny posted:

can someone remind me what's wrong w/ clojure again? i'm picking it up again i think

dynamically typed (setting aside core.typed for now), like all lisps a pain to edit without paredit (but simple once you learn that), the stack traces are horrible (you can kind of improve this situation with some libraries, and with practice reading them, but this seems to be a common issue with JVM dynamic languages where much of the stacktrace comes from the hosted runtime. compare with groovy, for example).

but its shortcomings are more than made up for by the awesome concurrency primitives and persistent data structures and immutability by default everywhere

also leiningen and having a stupid easy REPL to jack into for debugging and exploratory programming loving own bones

Deus Rex fucked around with this message at 11:32 on Mar 20, 2014

Deus Rex
Mar 5, 2005

coffeetable posted:

js lambdas are js functions, and the biggest problem with js functions is late binding. if you have a function f, then
  • if you call obj.f(), the keyword this will be bound to obj
  • if you call new f(), the keyword this will be bound to a new object.
  • if you call f(), the keyword this will be bound to ~~the global namespace~~
the two important implications are that
  • if you declare a function inside another function and use the outer function as a method, then within the inner function this still refers to the global namespace.
  • if you write a function f() meant to be used as a constructor, using lots of this.prop = val kind of statements, and then accidentally call it without the new keyword, js will silently clobber the global namespace for you.

"this" is why you never write object-oriented javascript, ever

double sulk
Jul 2, 2010

What is Hack?

Hack is a programming language for HHVM that interoperates seamlessly with PHP. Hack reconciles the fast development cycle of PHP with the discipline provided by static typing, while adding many features commonly found in other modern programming languages.

Hack provides instantaneous type checking via a local server that watches the filesystem. It typically runs in less than 200 milliseconds, making it easy to integrate into your development workflow without introducing a noticeable delay.

Deacon of Delicious
Aug 20, 2007

I bet the twist ending is Dracula's dick-babies
ahaha

so i just looked up what HHVM stands for

Notorious b.s.d.
Jan 25, 2003

by Reene

double sulk posted:

What is Hack?

Hack is a programming language for HHVM that interoperates seamlessly with PHP. Hack reconciles the fast development cycle of PHP with the discipline provided by static typing, while adding many features commonly found in other modern programming languages.

Hack provides instantaneous type checking via a local server that watches the filesystem. It typically runs in less than 200 milliseconds, making it easy to integrate into your development workflow without introducing a noticeable delay.

dont forget it is written in ocaml

Notorious b.s.d.
Jan 25, 2003

by Reene
and the hack ide runs in a web browser. naturally it is ocaml compiled to js

Toady
Jan 12, 2009

Monkeyseesaw posted:

objc as a language is pretty ok but the core framework has some huge loving holes. there's *still* no official url-encode string method so you have to pull bullshit like this from random github gists or blog posts. they just added a base64-encoding function to the ios frameworks in ios7. that was... 4 months ago?

because why the gently caress would you ever need to construct a url in a mobile app. apple certainly can't think of a reason.

yeah the frameworks are schizophrenic, some areas have tons of convenience while others miss basic functionality for years. you can file bugs all you want but they'll be marked as dupes

Shaggar
Apr 26, 2006
the only cool thing in obj is the arc everything else is super dumb

Nomnom Cookie
Aug 30, 2009



ARC is pretty sweet

Tokamak
Dec 22, 2004

double sulk posted:

What is Hack?

in future software development books there will be a chapter about facebook's (modified) spiral model. sunk cost fallacy and hacker philosophy form a negative feedback loop, causing each iteration of a project to come up with increasingly costly and abstract solutions to fix problems encountered in the last abstract solution.

has anyone sat down and said: hey facebook has made some big design and architectural changes over the years; lets rewrite the platform to remove the overhead and comprises that come from iterating on an old, monolithic, PHP codebase. or have they been secretly writing a PHP to asm compiler that outperforms the best optimising c-lang compilers?

oh, i see they created a fully interactive visualisation tool for dependancies (in 2011), becuase the old line and node diagrams just can't cope...

https://www.facebook.com/notes/facebook-engineering/visualizing-facebooks-php-codebase/10150187460703920



Suspicious Dish
Sep 24, 2011

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

hackbunny posted:

in fact I think the earliest version of javascript didn't even have arguments.callee, and you had to use the function's name, or the name of a variable that contained the function (how'd you write recursive anonymous functions? you couldn't)

do not use arguments.callee or arguments.caller. it's flat out removed in strict mode, since it prevents the JS engine from JITting or inlining.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Suspicious Dish posted:

do not use arguments.callee or arguments.caller. it's flat out removed in strict mode, since it prevents the JS engine from JITting or inlining.

how do you recurse in an anonymous function then? :confused:

e: how is getting a function pointer going to interfere with jit? :confused: it's type metadata, not code
e2: genuinely curious, I love compiler design & theory

hackbunny fucked around with this message at 09:51 on Mar 21, 2014

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

hackbunny posted:

how do you recurse in an anonymous function then? :confused:

e: how is getting a function pointer going to interfere with jit? :confused: it's type metadata, not code
e2: genuinely curious, I love compiler design & theory

y combinator

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Malcolm XML posted:

y combinator

ugh, seriously? twist your code into a mobius pretzel instead of allowing arguments.callee with restrictions?

e: tried my hand at functional programming:

JavaScript code:
// arguments.callee
var fact0 = function (x) {
    if (x === 0)
        return 1;
    else
        return x * arguments.callee(x - 1);
};

alert(fact0(5)); // how else? just as god intended

// combinator
function F(f) {
    return function(x) {
        return f(f, x);
    };
}

var fact1 = function(f, x) {
    if (x === 0)
        return 1;
    else
        return x * f(f, x - 1);
};

alert(F(fact1)(5)); // a little like triple-indirected pointers in C

// Y-combinator
var fact2 = function(f) {
    return function(x) {
        if (x === 0)
            return 1;
        else
            return x * f(f)(x - 1);
    };
};

alert(fact2(fact2)(5)); // are you loving with me
and immediately regretted it

e2: don't say

JavaScript code:
var fact3 = F(fact1);
var fact4 = fact2(fact2);
that's cheating, you are still expecting Javascript programmers to do that reliably

hackbunny fucked around with this message at 11:05 on Mar 21, 2014

Deus Rex
Mar 5, 2005

hackbunny posted:

how do you recurse in an anonymous function then? :confused:

e: how is getting a function pointer going to interfere with jit? :confused: it's type metadata, not code
e2: genuinely curious, I love compiler design & theory

just give it a name.

code:
function callWithTen(f) { return f(10); } // function declaration
console.log(callWithTen(function fact(n) { // function expression
  if (n <= 1) return 1;
  return n * fact(n - 1);
}));
it's not really "anonymous", but when used in a function expression the name doesn't escape its own scope, i.e. a hypothetical line of code at the top scope there that calls fact(20) will fail.

Vanadium
Jan 8, 2005

Tokamak posted:

has anyone figured out a good way to represent lambdas in traditional brace/block structured languages? or is it practically impossible without significantly overhauling the way a language's compiler parses the code (and making everyone mad)?

The lambda isn't really the problem in that example, and I don't think the lexical syntax for anonymous functions is really the problem in most languages with them. I'm not sure what non-brace/block-structured languages do it much better?

Shaggar
Apr 26, 2006
if you think the problem in that example is the syntax you're also the problem

Suspicious Dish
Sep 24, 2011

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

Deus Rex posted:

just give it a name.

code:
function callWithTen(f) { return f(10); } // function declaration
console.log(callWithTen(function fact(n) { // function expression
  if (n <= 1) return 1;
  return n * fact(n - 1);
}));
it's not really "anonymous", but when used in a function expression the name doesn't escape its own scope, i.e. a hypothetical line of code at the top scope there that calls fact(20) will fail.

Right. Named function expressions only declare the name within their own line, so they're perfect for the "recursive anonymous function" use case.

JewKiller 3000
Nov 28, 2006

by Lowtax

Malcolm XML posted:

y combinator

oh right you can write that, we're in javascript so we don't even have the simply typed lambda calculus :sigh:

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

hackbunny posted:

how do you recurse in an anonymous function then? :confused:

e: how is getting a function pointer going to interfere with jit? :confused: it's type metadata, not code
e2: genuinely curious, I love compiler design & theory

it doesnt block jitting

the arguments array makes it basically impossible to do data flow analysis involving parameter variables, because anything that could cause a call to user code (i.e. basically everything) could reflectively modify the arguments array, which iirc is specced to alias the parameters

and the callee stuff blocks you from doing any useful call-graph or escape analysis, e.g. to try to help with the above

so you can have something like function(x,y,z) { return x+y+z } which you might think would be really easy to prove a lot of things about

but the implicit conversions as part of the first plus could invoke user code that does thisFunction.callee.arguments[2]++ or something like that

or just stash the callee somewhere so now you cant prove anything about all the known callers or something

JewKiller 3000
Nov 28, 2006

by Lowtax

rjmccall posted:

everything in loving javascript makes it basically impossible to do data flow analysis

Suspicious Dish
Sep 24, 2011

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

rjmccall posted:

but the implicit conversions as part of the first plus could invoke user code that does thisFunction.callee.arguments[2]++ or something like that

Hm, are you sure? I thought Function.prototype.arguments was flat out removed in ES5.

qntm
Jun 17, 2009
E: ignore this

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Suspicious Dish posted:

Hm, are you sure? I thought Function.prototype.arguments was flat out removed in ES5.

who the gently caress cares what the loving ecmascript standards committee did

maybe that poo poo matters if you agonize over putting all of your javascript code in pretty little precisely-versioned script tags

go gently caress yoursefl

out in the real loving world deprecation is meaningless and browsers will support this poo poo forever

Suspicious Dish
Sep 24, 2011

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

rjmccall posted:

who the gently caress cares what the loving ecmascript standards committee did

maybe that poo poo matters if you agonize over putting all of your javascript code in pretty little precisely-versioned script tags

go gently caress yoursefl

out in the real loving world deprecation is meaningless and browsers will support this poo poo forever

"use strict"

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Sure, you have to support the old code, but you can just give it lovely performance. Browsers are already killing fancy JIT optimizations for non-strict-mode code.

Adbot
ADBOT LOVES YOU

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

rjmccall posted:

who the gently caress cares what the loving ecmascript standards committee did

maybe that poo poo matters if you agonize over putting all of your javascript code in pretty little precisely-versioned script tags

go gently caress yoursefl

out in the real loving world deprecation is meaningless and browsers will support this poo poo forever

you are my hero

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