« first day (1389 days earlier)      last day (3561 days later) » 

10:03 AM
@zigi what's america? never heard of it
 
:D
some country
I think it is near Kazakstan
but I am not sure
 
@monners -> finally, I solved the problem
 
@Oleg there's America, the land mass composed of two continets, North America, on which there is Canada and United States of America, and South America, on which there is a bunch of spanish-speaking countries whose names mostly end in "ia".
 
Mexico is a Spanish-speaking and it is in North America?
 
It's pretty close to South America, however.
 
10:06 AM
yeah, you wish
 
!!America is a country or a continent?
 
@Oleg a continent
 
^ see? Caprica's always right
 
 
!!are you always right?
 
10:07 AM
@JanDvorak Yes!
 
As you can see big part of the States used to be part of mexico
 
Big part of the States used to be part of Russia too.
 
!!Do Ash Ketchum and Misty ever kiss?
 
So what's your point?
 
@AaditMShah Doubtfully
 
10:08 AM
!!How old are you?
 
@AaditMShah I can neither confirm nor deny
 
!!What's your name?
 
@Oleg are you familiar with the geo part of d3 as well?
 
@AaditMShah That didn't make much sense. Use the !!/help command to learn more.
 
Yeah, and all of the American's ancestries used to come from different continents besides Native Americans
 
10:09 AM
I think I broke @CapricaSix.
 
@SecondRikudo Haven't had a chance to work with it yet... still uncharted territory for me :(
 
Alright, thanks :P
 
!!ASL?
 
@AaditMShah That didn't make much sense. Use the !!/help command to learn more.
 
!!ASL?
 
10:11 AM
!!asl
 
@zigi That didn't make much sense. Use the !!/help command to learn more.
 
!!asl pls
!!what is your age
 
@zigi My pocket dictionary just isn't good enough for you.
 
Anyway, do you guys know of any JavaScript library which performs partial evaluation of programs or converts map reduce programs into loops?
 
!!google haskell compiler in javascript
 
@JanDvorak I already looked at the output of GHCJS. It doesn't do the job.
 
@AaditMShah what's your purpose?
 
For my final year project I need to implement a compile-to-JavaScript language with two features: guarantees of code correctness (upto type correctness) and code optimization (via partial evaluation, stream fusion, etc). To do so my professor asked me to find existing or related work in the domain.
 
!!is Awal Garg my real name?
 
Check if the closure compiler does stuff like that
 
10:16 AM
I couldn't find any compile-to-JavaScript language which does any beneficial code optimization. All the FP -> JavaScript languages like PureScript, Haste, GHCJS, Faye, etc. have type systems. None of them have a good code optimizer.
 
I bet she can't answer that correctly ever, ever in her life :D
 
!!should I write a haskell to javascript compiler?
 
@JanDvorak Yes!
 
peq
there also is llvm to javascript (I think asm.js) which does some optimizations
 
@peq Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
10:18 AM
@peq haskell -> llvm -> javascript, you say?
 
@Jan The closure compiler doesn't perform partial evaluation. Neither can eliminate dead code because there is no module system in JavaScript. It can't decide whether an unused variable or function will be used in some other file.
 
@AaditMShah it surely can for local variables, can't it?
One nice thing about haskell -> javascript compilation is that IO is inherently callback-based
 
@peq Emscripten doesn't produce good enough code. LLVM when converted to JavaScript suffers from code bloat.
 
Emulating immutable DOM nodes will be tricky.
 
10:21 AM
I've haven't checked whether it removes unused global variables. Gimme a sec.
Currently I'm not focusing on IO or the DOM.
 
I guess I should make DOM impure by default?
 
That's the logical way to go.
Plus DOM elements have a lot of state.
 
With a method that takes a pure snapshot of the node and its descendants?
 
@JanDvorak No. The closure compiler doesn't remove unused local variables either. Not much of an optimizer is it? It seems to me that it's just a minifier.
Correction minifier plus JSLint.
 
Anyone knows how to make ngAnnotate work with multiple files in Grunt?
 
@AaditMShah it does for me, even at "simple" settings.
 
Let me know if anyone can get it to do any beneficial optimizations.
 
window.func = function(){
  var a = 1;
};
// =>
window.func=function(){};
It even does constant folding
 
@JanDvorak Okay. It does eliminate local variables. I was trying to make it eliminate an argument.
 
@AaditMShah hmm...
It does remove arguments on "advanced" settings
It even conjures formal arguments for arguments accessed as arguments
window.func = function(){alert(arguments[0]);};
//=>
window.a=function(b){alert(b)};
 
10:30 AM
Cool. Does it perform partial evaluation?
 
It handles arithmetic just fine, but it seems to be baffled by array access. It doesn't even touch [1,2,3][1,2,3].
 
According to this document advanced options only perform renaming, dead code removal and inlining.
 
@AaditMShah Arithmetic is a simple optimisation
 
Okay, so we have a decent JavaScript -> JavaScript optimizer? What about some-other-language -> JavaScript optimizer?
I agree. It's a limited form of partial evaluation.
 
@AaditMShah you can compile through Javascript :-)
 
10:35 AM
0
Q: Testing an asynchronous function in an angular factory

kalleIm new to testing and im trying to test my angular code in Jasmine. Im stuck on the problem of testing the answer from an resolved promise. Right now the test gets timed out. I would like to have the test waiting for the respons instead of just put in a mockup respons. How do i do that? Is it a b...

 
Compile to JavaScript and then pass the output through the closure compiler?
 
yep
 
I think that's a bit wasteful. First because FP languages like Haskell have strictly more information than equivalent JavaScript code (i.e. you lose information when compiling Haskell to JavaScript - e.g. type information is lost).
It's easier to optimize when you have more information about the code you're optimizing.
 
123
 
@user3681138 Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
10:38 AM
hahaha
deductive skills
 
Second, it just takes more time. Optimization should be done during compile time. Not afterwards.
 
coffeescript: alert (x*x for x in [1..3])
compiled and minified: var x;alert(function(){var a,b;b=[];for(x=a=1;3>=a;x=++a)b.push(x*x);return b}());
compiled and optimised: var a,b=alert,c,d;d=[];for(a=c=1;3>=c;a=++c)d.push(a*a);b(d);
 
See that's one thing I don't like about CoffeeScript. It's just a syntax translator. It doesn't do any code refactoring, which a compiler can very well do. A human would translate this to:

var a=[],x=1;while(x<=3)a.push(x*x++);alert(a);

Which is much smaller. A compiler should do the same. My argument is that if a human can do it then so can a computer.
 
Oh hi @AaditMShah how have you been doing?
You've missed a big computability discussion yesterday :)
 
@BenjaminGruenbaum I'm doing good. College finally reopened. Final year. Got a project to do.
 
10:44 AM
Coolstuff :)
 
@AaditMShah your code doesn't work ;-)
 
Awww. I should check into this room more often.
 
Syntax is expensive.
 
@JanDvorak Now?
 
@AaditMShah nope
 
10:45 AM
@AaditMShah what about TypeScript?
There are no good FP code optimizers for JS.
 
@JanDvorak It works fine: jsfiddle.net/vC4GU
 
You can look into Mark Miller's work about security and correctness, it's fascinating.
Nothing about performance though.
 
@BenjaminGruenbaum I haven't tried TypeScript. I should look at it though.
 
@AaditMShah it's JS with a structural type system and ES6 syntax.
The closest thing ES is getting that's close to performance is TCO, and that's very simple and not very clever.
 
@AaditMShah but it's still ugly ;-)
 
10:47 AM
@JanDvorak It's shorter.
 
@JanDvorak how do you judge whether code is looking ugly or beautiful?
 
@BenjaminGruenbaum Brian McKenna wrote a library for TCO in JavaScript.
 
@AaditMShah alert([1,4,9])
 
that's what I call partial evaluation
 
10:48 AM
and why can't ugly looking code be good?
 
@JanDvorak Trivially any non IO code can be evaluated by the compiler beforehand.
Whether this is correct behavior or not is a matter of debate.
 
@AaditMShah Any code that does not rely on I/O or external side effects - which is pretty much no code.
 
What if you try to optimize an undecidable problem by evaluating it at compile time?
 
@AaditMShah s/non-IO/pure, and even then only if you can rule out infinite loops
 
The compiler would never halt.
 
10:49 AM
HAMMERZEIT!
 
@BenjaminGruenbaum I concur.
 
@AaditMShah so what?
Ah, that was an answer to @JanDvorak
Yeah.
 
I got to eat lunch. I'll be back in 10 minutes.
 
@AaditMShah its almost evening in IST bro!!
 
I just came back from college.
 
10:52 AM
New life goal: whenever someone says something about their future actions, ask him if he's sure.
 
You sure?
 
@drnessie Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@drnessie it is my goal
 
@JanDvorak why?
 
@AwalGarg why not?
 
10:55 AM
@JanDvorak not, because life goals should be big, specially when you got knowledge at hand. And I think you are pretty intelligent.
 
I can have multiple simultaneous goals.
as in, side quests
I can look for free-laying raven tongues while searching for 20 bear asses
 
would you do no hesitation in dropping this "life" goal if and when required?
 
Are you sure?
 
@AwalGarg perhaps.
 
perhaps you are presently just overly inspired by that "life" goal and you would be alright with time (half an hour?), or you are just kidding me (this is rare though :P)
 
11:00 AM
"life goal" is really hyperbolic, I admit. It's just a thing I'd really like to remember I meant to do
 
kk...
 
So this is the abstract that I am currently working on.
I need to write about existing work in the domain.
 
I would phrase myself differently.
All the things you list as problems are problems subjectively. While I agree with some/most of these points I don't think it would be very professional to phrase your paper this way.
 
Oh, so I want to build a functional programming language which compiles down to JavaScript for my final year project.
 
JavaScript is also not the 'fastest dynamic language'
 
11:07 AM
Lua?
 
Perhaps, in some domains.
 
One of the fastest dynamic languages.
 
how can we even call a single programming language as fastest dynamic language in any case?
 
You have to be a lot more precise in your paper if you want to meet academic standards. Honestly it kind of looks like a rant at JS in the first part and then very very partial research on the second.
 
Probably one of the fastest, but you should really avoid making baseless claims - what Benjamin just said
 
11:09 AM
You should cite papers not stuff people said on the internet.
 
Exactly
 
I agree. Unfortunately people don't write papers about languages like CoffeeScript and PureScript.
 
hahaha. I publish a paper with bullshit, in my next paper, I cite the bullshit! :D
 
They do however write papers about Curry and functional logic programming.
 
11:10 AM
!!xkcd citogenesis
 
research.microsoft.com/apps/pubs/default.aspx?id=176601 @AaditMShah second Google result. Also relevant.
 
wait, did they just disable the context menu here? snap... my mouse is dead.
 
@BenjaminGruenbaum For some reason I can't see the papers you're referencing me to.
 
@AaditMShah There is plenty of existing research and publications about JavaScript, about compiling to it and about type systems. There is a lot of research about optimizing functional code and optimizing it. Do not cite someone saying something on GitHub as the main citation. Any unsubstantiated claims you make will be butchered by a good reviewer.
@AaditMShah you can see the abstract, to see the papers you'll need to get a copy of the publication which your college will have. You can alternatively email Microsoft research and ask for a copy and they'll gladly send it.
 
11:13 AM
Alright. I need to rethink my abstract from the ground up.
 
I'm sorry if I sound harsh, if it's just an assignment and not something you hope to publish some day take what I say with a grain of salt.
 
unless your teacher might be a dick, ofc
 
Hey, better said from a friend than a publisher, or a professor.
 
0
Q: How to listen to a Clojure promise when it is was realized or failed?

fifigyuriI have a Clojure promise. When it's realized or fails I'd like to fire an action. How to do it in Clojure? Here: http://dev.clojure.org/display/design/Promises then and recover is described which should give a possibility to define such callbacks, but it is not in the clojure core as I see it.

 
11:16 AM
What about published books? Can you cite published books?
 
YES
Yes you can cite published books
Papers are probably best though
 
@AaditMShah yes, like @drnessie said papers are usually better though.
Also, it's always better to cite something other people have previously cited too. That might not be very possible in your case though.
 
Hi all, is anyone aware of any limit of using style tags in a html document in IE 8 and 9 ?
 
@Yoda no, but they act funky if created in JS, you have to use a propitiatory IE API.
 
11:20 AM
@Yoda if you have 256 tags, IE might not hate you, but I will.
 
@BenjaminGruenbaum I have read articles saying when using link tags limit is 30/31
 
@JanDvorak You made me snort
Pretty funny
@Yoda there is no real limit
 
I'll go do some work now. Thank you for the pointers.
 
even 31 a bit is too much
 
@JanDvorak what is your options if you have more than 256 widgets and you have different styles for them on a single page ?
 
11:22 AM
@Yoda collect them to a single file
 
0 should be your limit man. these all people are just trolling you. 0 is the real limit.
 
Put them in the same stylesheet?
 
@drnessie yes
 
Good point Awal - it's best practice to not use <style> tags but instead link to an external .css file using <link> tags
 
fucking intelligent you people are!
 
11:23 AM
@JanDvorak those values are available while rendering the view in asp.net mvc web app. I can't put those in external stylesheet as values are not available.
 
@drnessie you should not use the link tag for stylesheets unless necessary...
 
(@Awal that's what I said, sorry if I worded it badly)
 
@Yoda would inline styles make sense?
 
@JanDvorak that is what I'm using with combination of style tags as well but IE8 ignores some of them.
 
@Yoda can you ignore IE8 in return?
 
11:25 AM
can't do it :(
 
you can either ignore IE, or all real browsers.
 
best case: can you generate a single sheet on the server?
 
you can use a css precompiler.
 
You may just be using a style that isn't available in IE8, something CSS3-y
 
^
most CMSes include a way to minify CSS for you
 
11:27 AM
@JanDvorak me or drnessie or both?
 
I think you
 
both, actually
 
guys believe me, I have a chat service idea, which will solve all such confusions, and many others, but you will get that sophisticated a chat service only after I am done becoming a JS expert atleast 20% of what Jan and others here are :P
 
something like miaou?
 
I don't doubt it @AwalGarg but chat is a problem as old as time, somehow I think that most things have been tried already :)
 
11:31 AM
@JanDvorak i think miaou is just another version of SE chat, without mods. not that dystroy isn't great, but... we have grown modern haven't we. this is not enough?
 
user3141603
Hi. Why this code doesn't work?
 
user3141603
            setInterval(function () {
                $("body > div > a").animate({
                    "color": ($("body > div > a").css("color") == "#808080") ? "red" : "#808080"
                }, 300);
            }, 1000);
 
@VladGincher define "doesn't work"
 
@drnessie we will see... maybe next year :D
@JanDvorak haha. we can add a listener to caprica for that purpose lol
 
@VladGincher do you include the color animation plugin?
 
user3141603
11:32 AM
@JanDvorak Nothing happening. I'm not receiving Error and the color doesn't changes...
 
user3141603
@JanDvorak :O No
 
@VladGincher are you sure the selector is correct?
 
user3141603
What is it?
 
user3141603
Yes, the selector is currect
 
@VladGincher well, jQuery cannot animate colors by itself
 
11:33 AM
are you sure you ran this code in your browser only?
 
CSS3 can, though
 
Jan is correct. but you can try adding numbers is jQuery. it always works for me.
 
user3141603
:18101006
                 setInterval(function () {
                    $("body > div > a").css({
                        "color": ($("body > div > a").css("color") == "#808080") ? "red" : "#808080"
                    }, 300);
                }, 1000);
 
user3141603
This ^ workes only once
 
user3141603
it changes the color once and then stops
 
user3141603
11:36 AM
(this is without animation. For the animation I'll use CSS3)
 
perhaps the color isn't returned in the format you expect?
 
user3141603
Hmm...
 
user3141603
So what can I do?
 
@VladGincher looping animation in CSS3
 
user3141603
:|
 
user3141603
11:37 AM
Good idea :D
 
user3141603
TNX
 
s/loo//
 
I can already tell you your site will be ugly as hell already, though
 
user3141603
This is not a regular website
 
why do you want flashing links?
 
11:39 AM
@VladGincher why would you want to make a blinking link with a 300ms transition
 
Heh, <blink>blink</blink>
 
user3141603
@zigi I put the 300 just to see how it goes
 
the question is why do you want it to blink at all
@Cerbrus you know the blink tag was invented as a joke
by a drunk IT guy
 
user3141603
 
user3141603
The red color is ugly, but I cannot leave the title gray if the name is code red
 
11:41 AM
What's in the left-most tab?
 
@zigi: Now you're just messing with me :P
 
@VladGincher w3schools???? why?
 
Burn it with fire!
 
user3141603
@AwalGarg WherE?
 
11:42 AM
@VladGincher why when in juish
 
36 secs ago, by Meredith
What's in the left-most tab?
 
english text is still from left to right?
 
user3141603
Yes...
 
siht ekil ton yhw
 
user3141603
?
 
11:42 AM
!!should VladGincher use w3schools?
 
@Oleg Doubtfully
 
Adequate answer
 
@VladGincher I get it why your code doesn't work... you refer to w3schools.
!!should anyone use w3schools?
@Oleg ^is a better question...
 
thgir ot tfel morf daer uoy t'nac
 
user3141603
The I opened the W3SCHOOL to see if I need to use setInternal because it worked only one time like setTimeout
 
11:44 AM
in Chat feedback, Oct 8 '10 at 9:37, by Feeds
All feedback welcome!
 
yssem tib a skool ti
 
@zigi werbeh ni ton
@VladGincher use MDN
 
wow, thats pretty old. 2010!!
 
user3141603
I wanted to check that I wasn't confused
 
@JanDvorak cibara ni osla
 
11:45 AM
@zigi haey
 
@igiz
 
looc skool siht yllutca
 
@VladGincher wat?
 
I actually got a C in a hebrew GCSE
 
I can't speak in a fancy language :(
uhh
Je pomplemousse! Le avec moi famille et el
 
11:47 AM
@VladGincher it is english just written from right to left
 
@VladGincher is saying something about why we are all speaking like hebrew
 
@karovDnaJ karovDnaJ@
 
Grenouille de tart!
 
@Cereal la pupu la papa le pipi lo pu pui
 
I only got a C okay!
 
11:47 AM
日本語も話しましょうか。
 
no japanese you asian lover
 
user3141603
 
Yes, I can read/write japanese!
 
That's not japanese
 
Can we at least stick to english?
 
11:47 AM
I'm like 76% sure
 
user3141603
But my English suckes
 
It is Japanese...
 
@Cereal it is
 
@Cereal it is
 
...
 
11:48 AM
okay it is
 
THE FLAG SYSTEM IS NOT FOR YOUR PERSONAL ENJOYMENT STOP FLAGGING POINTLESS CRAP
2
 
:(
 
It says "Can we speak japanese"
 
user3141603
OK I'm going to eat breakfast. See ya
 
</vent>
 
11:48 AM
@rlemon who flags what?
 
My <insert eastern language here> is nonexistent
 
Or "Can we also speak..."
 
THE CAPS LOCK IS NOT FOR SHOUTING AT OTHERS STOP LOCKING CAPS
 
hey @Cerbrus ik kan een Oost-Europese taal praten
 
@rlemon "if there is any doubt about a foreign language raised, the flags should be validated". Doesn't change the fact the flags were pointless, though
 
11:49 AM
THE CHAT IS NOT FOR SPEAKING TO PEOPLE
oh wait
 
really?
hm, interesting
 
@JanDvorak I only yell because the original flagger asked for the language to resume english AFTER flagging.
!!afk late for work.
 
 
Wait, is there a rule about only speaking English?
 
yes
 
11:50 AM
Pretty much so.
 
read the rules you fick
 
in this room, yes
 
@drnessie yes
 
But no flagging for that?
 
Why did people flag that?
 
11:51 AM
@Cerbrus askt hem to stop, if they don't flag as spam.
 
!!is rlemon angry about something?
 
A simple "please use english" will suffice...
 
cause them people be stupid
 
Oh, okay
 
but don't shoot first and ask questions later
 
11:51 AM
@Oleg No way
 
or they don't like hebrew
@rlemon I thought we are in 'Merica
 
!!does rlemon not appreciate flagging?
 
Probably some 1% discrimination we should report to the UN
 
@Oleg Frankly my dear, I don't give a dean
 
!!afk late for work
 
11:52 AM
@Cereal haha I swear, not me this time
 
I always shoot first, and ask later... cough
 
We're all living in America
Coca-cola, sometimes war
 
going back to the corner
 
we're all living in America,
ist wunderbar, ist wunderbar
 
user3141603
!!Hi
 
11:52 AM
Any way, sorry, guys. I though flagging was the right course of action, my apologies
 
where I first saw you
 
@VladGincher Hello !! I am Caprica. Caprica Six. How are you?
 
gonna camp in my sleeping bag
 
Can I flag if I am a grammar nazi?
 
user3141603
!! I'm Great! How are you?
 
11:53 AM
@VladGincher Indubitably
 
for bad grammer?
 
i am not gonna move
 
user3141603
Don't woy all work?
 
We need GrammerLint
 
user3141603
you*
 
11:54 AM
!!tell VladGincher sandbox
 
@VladGincher You know, there was this funny idea once upon a time that people were supposed to test out commands and "play" in the sandbox
 
For the love of God
18 flags
 
I can only see 12
 
got some words on cardboard
 
what's getting flagged?
 
11:59 AM
@GNi33 those two messages in hebrew are accumulating flags
 

« first day (1389 days earlier)      last day (3561 days later) »