Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

JIT, optimization, data structures

Name: Anonymous 2011-10-21 11:02

Little Ive writes the following code in a dynamically typed programming language called Anus that features a GC and JIT.

var make_tuple = function(x,y){
  return function(i){
    return (i==0) ? x : y;
  }
}


Little Ive then calls the function make_tuple repeatedly with int32 in a tight loop, and sometimes also calls it with other arguments of other types as well.

How should Anus optimize this?  Discuss the situation and its complexities.

Name: Anonymous 2011-10-21 11:17

>>1
Anus is broken because JIT and GC are not language features, but implementation details.

Name: Anonymous 2011-10-21 11:20

>>2
Anus seems to be one of those new and hype ``Open Source'' ``Web languages'' which are defined by their reference implementations. Yet another terrible reinvention of the, already bad, JavaScript language.

Name: Anonymous 2011-10-21 13:39

JIT
IT'S COMPILED BUT IT'S NOT REALLY COMPILED BUT IT'S KINDA INTERPRETED BUT IT ISN'T REALLY INTERPRETED

Name: Anonymous 2011-10-21 13:39

>>1
Since it is a dynamic typed language, I'm assuming it's also using tagged pointers, and a sane encoding for word-sized integers (INTVALUE|0, where INTVALUE is a WORDSIZE-1 signed integer value, and the 0 to distinguish between immediate integers and pointers).
So, i == 0 would be an actual test for zero, no need to even check whether i is an integer, assuming that == just returns false on type mismatch (which is probably so, in a JS-like language), or no other numerical types (unlikely), or that 0.0 != 0 (again unlikely), or that the other arguments of other types are not numerical or can't be a non-integer zero (possible).

Name: Anonymous 2011-10-21 14:18

>>5
It's compiled, just not AOT.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List