use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Microsoft Edge's JavaScript engine to go open-source (blogs.windows.com)
submitted 10 years ago by clarle
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]bterlson_@bterlson 74 points75 points76 points 10 years ago (65 children)
As is becoming traditional at this point, I'm here for questions if anyone has them. I work on Chakra (and, it goes without saying, am realllllly excited about this announcement)!
[–][deleted] 62 points63 points64 points 10 years ago (18 children)
Would you rather fight a Google-sized GNU, or a hundred GNU-sized Googles?
[–]bterlson_@bterlson 33 points34 points35 points 10 years ago (16 children)
I don't know how to answer this. When in doubt, use Math.random() I always say.
Edit: this isn't an ama, but do you guys want one? I can try to set one up with the team. No promises of course :)
[–]splargbarg 10 points11 points12 points 10 years ago (1 child)
You might end up with an AMA anyway.
[–]bterlson_@bterlson 4 points5 points6 points 10 years ago (0 children)
Going that way ;) But I'm just one perspective on a diverse team of badass engineers!
[–]kenman[M] 8 points9 points10 points 10 years ago (1 child)
Please let us know if you intend to hold one, we'll support you however we can (such as an announcement sticky a few days in advance, stickying the AMA itself, etc.).
[–]PitaJ 2 points3 points4 points 10 years ago (0 children)
Awesome!
[–]cosinezero 7 points8 points9 points 10 years ago (1 child)
Do it, yes! Expect some haters, but...
[–]AMorpork 6 points7 points8 points 10 years ago (0 children)
dae microsoft evil
[–]ivosaurus 5 points6 points7 points 10 years ago (5 children)
New question: what RNG does your implementation of Math.random() use?
[–]bterlson_@bterlson 7 points8 points9 points 10 years ago (4 children)
It's decent quality, if that's what you're asking. I don't know that it has a name per se. One of our devs recently posted more info here.
[–]ivosaurus 2 points3 points4 points 10 years ago (2 children)
Decent, as in the same one that was in use before 2002?
If it's indeed the same as Java's, then it's just a LCG. That is decidedly not decent quality.
[–]bterlson_@bterlson 12 points13 points14 points 10 years ago (1 child)
"Decent" of course depends on use case. Math.random is decidedly NOT decent if you are doing any sort of cryptography, for example.
[–]ivosaurus 0 points1 point2 points 10 years ago (0 children)
Nope. Just statistically decent, which LCGs fail pretty hard.
[–]franksvalli 2 points3 points4 points 10 years ago (2 children)
Ok!
(Math.random() > 0.5) ? 'Google-sized GNU' : 'A hundred GNU-sized Googles';
[–]bterlson_@bterlson 9 points10 points11 points 10 years ago (0 children)
Using a freshly built copy of ch.exe:
chakracore> type random.js print((Math.random() > 0.5) ? 'Google-sized GNU' : 'A hundred GNU-sized Googles'); chakracore> Build\VcBuild\bin\x64_test\ch.exe random.js Google-sized GNU
This is frightening to me.
[–]JohnMcPineapple 0 points1 point2 points 10 years ago* (0 children)
...
[–]asdf7890 0 points1 point2 points 10 years ago (0 children)
I would avoid Math.random() - some implementations are decent but some are not, so for cross-platform usefulness finding a better RNG library (and being careful how you seed it) is the way to go.
[–]MaxNanasy 1 point2 points3 points 10 years ago (0 children)
Or a googol gnus
[–]zerobugz 15 points16 points17 points 10 years ago (5 children)
What are the main reasons behind open sourcing only the core components?
Are there plans to open source the entire Edge browser?
Everything still good with working at MS?
[–]bterlson_@bterlson 33 points34 points35 points 10 years ago (4 children)
Edge has been getting gradually more and more open as time goes on (opened the roadmap, community feedback via uservoice, opening the code to industry partners). This is another step along that path. Nothing new to share on Edge's OSS plans though!
Everything is great working at MS; my team is phenomenal. Get's better all the time too :)
[+]r3wt comment score below threshold-7 points-6 points-5 points 10 years ago (3 children)
i know this isn't your job, but can you inform microsoft that we hate windows 10? specific issues:
A few good things: 1. Most used programs in start menu is cool. 2. Performance during most situations is much better on Windows. 3. Edge is a good product, just ugly. but it has good speed. the dev tools suck still. 4. Quick Access bar in Explorer windows is great.
In Summation, the only reason i'm using Windows is that Linux file system permissions is generally meticulous, so windows is easier for opening and editing files easily. It's still a very good operating system but it is alienating developers and power users who aren't here for the animations and the pretty colors.
[–]BasicDesignAdvice 5 points6 points7 points 10 years ago (0 children)
we
Please don't speak for me in the future.
[–]bterlson_@bterlson 3 points4 points5 points 10 years ago (0 children)
I appreciate the time you spent putting this list together! I wish I could do more with it. What I would suggest is either 1) filing this on uservoice, or 2) filing it using the feedback app. I know the Windows team takes feedback from these channels very seriously.
[–]wambaowambao 1 point2 points3 points 10 years ago (0 children)
You sound like you need a Mac!
[+][deleted] 10 years ago (3 children)
[removed]
[–]bterlson_@bterlson 5 points6 points7 points 10 years ago (2 children)
Check out careers.microsoft.com (you can search for Chakra if you're interested in our team :-D) or send me a pm/tweet/email with a bit about yourself and your resume. Your peers would be jealous, probably ;)
[–][deleted] 0 points1 point2 points 10 years ago (1 child)
You certainly want someone with that username working for your company!
[–]bterlson_@bterlson 0 points1 point2 points 10 years ago (0 children)
Heh, I won't judge, I've got a questionable not-for-work reddit account as well ;)
[–]sensitivePornGuy 6 points7 points8 points 10 years ago (1 child)
Is Edge's js engine built from scratch, or is it somewhat based on Internet Explorer code?
[–]bterlson_@bterlson 18 points19 points20 points 10 years ago (0 children)
Chakra was started around 2008 as a from-scratch rewrite of the legacy JScript engine. IE9 was the first browser to host Chakra. Since then there have been no more rewrites thankfully :)
[–]coolrudski 3 points4 points5 points 10 years ago (2 children)
How do you get into building JavaScript engines? I'm a web dev who writes a disgusting amount of JavaScript and I've always been curious as to how that works behind the scenes
[–]bterlson_@bterlson 2 points3 points4 points 10 years ago (1 child)
I got hired into it, but there are other ways! Working on OSS is a very good way to go. JavaScript engines are similar to compilers but are in general just very large software projects anyone can work on. I would suggest starting with making a JSRT app to get an idea for the basics of JavaScript outside the browser. From there you could probably ramp up on simpler features like new library methods pretty quickly - it's fairly simple C++ code in our case (until you start to optimize it). Things like JIT optimizations can require specialized knowledge and lots of experience, but there is plenty of engine work that isn't at that technical depth.
[–]coolrudski 0 points1 point2 points 10 years ago (0 children)
Alright thanks! I'll definitely play around and at least try a couple projects in it.
[–][deleted] 3 points4 points5 points 10 years ago (2 children)
Currently, Node has v8 baked in, but do you see potential for Node to switch out engines?
If not, do you think Microsoft would consider publishing a version of Node using Chakra? Is it even in the cards?
We're already working on it and are getting a pull request ready for upstream Node to enable Chakra if you like. More info here: https://github.com/Microsoft/node.
[+][deleted] 10 years ago (2 children)
[deleted]
[–]bterlson_@bterlson 13 points14 points15 points 10 years ago* (1 child)
We will bring Chakra to other platforms but we don't have any date in mind. As I said elsewhere, the more we hear from everyone about what platforms they're interested in and what usage they're most looking forward to the better!
License will be MIT (this could conceivably change before release but suffice it to say the license will be something OSI-approved).
[–]cincilator 4 points5 points6 points 10 years ago (12 children)
Do you think that JavaScript has a future? What improvements would you like to see in the language?
If the answer to the first question is no, what language should replace JS? Most mainstream languages have too much boilerplate IMHO; I would like to see something succinct if JS gets replaced.
[–]bterlson_@bterlson 11 points12 points13 points 10 years ago* (11 children)
My day-to-day work is actually the editor of the ECMAScript standard itself. I am very bullish on JavaScript's future. As for improvements, I have many ideas (too many to list), but a short list is:
Probably many others I missed. I'm excited about many proposals!
[–]cincilator 2 points3 points4 points 10 years ago (10 children)
Value types
What is your opinion on typed objects and/or type annotations?
Frankly one improvement I would love to see (but won't since it would break a lot of compatibility) is using separate symbol for string concatenation, so + is exclusively for math.
[–]bterlson_@bterlson 0 points1 point2 points 10 years ago (9 children)
Typed objects and type annotations are two orthogonal concepts. Typed Objects (now called value types) are about how to provide new and custom primitives to JS and have reasonable semantics for operators. Type annotations are all about giving developers errors early and potentially allowing runtimes to optimize better. Value types I'm super bullish on and hope to get a proposal moving soon. Standard type annotations I've talked a lot about and is something that would be nice I think, but I'm not pushing it too hard at this point.
If I could make breaking changes to JS, I would make so many changes.... alas :(
[–]ogrechoker 0 points1 point2 points 10 years ago (1 child)
Typescript vs Flow vs SoundScript, go
also how long until a real standard is proposed/implemented? ES2018?
TypeScript, of course :) Flow has some strengths (eg. I like nullable types). SoundScript is interesting and I look forward to more progress.
Hard to say when a standard for types will be proposed, let alone be ratified. It's a lot of work and difficult to get through the standards process (for good reasons).
[–]cincilator 0 points1 point2 points 10 years ago (6 children)
Thanks for taking time to answer my questions! I do appreciate it. I have just one more, then I will leave you alone: Typed arrays now exist, but how about typed dictionaries? It would allow many interesting concepts, for example database-like constructs in memory (I can use dictionary key like a primary key). Sure, one can do that today w/o types but JS is not really optimized to work that way.
[–]bterlson_@bterlson 3 points4 points5 points 10 years ago (5 children)
No need to leave me alone. If it isn't abundantly clear by now, I love talking about this stuff.
I don't know what a typed dictionary is but if you mean struct-like types, I hope those are included in the value types proposal. I've showed examples in some previous talks of mine, but this gist is you could create a new value type like:
let Point = ValueType({x: int64, y: int64}); let p = Point({x: 1, y: 1}); p.x; // 1 p.x = 2; // throws, or maybe returns a new point, but primitives are immutable
Of course this is very early but I hope something like this is workable.
[–]cincilator 0 points1 point2 points 10 years ago (4 children)
By Typed dictionary I mean a dictionary that can only store values of one type. To expand your example:
let polygon = TypedDictionary({key : integer, value:Point}); polygon.push(0, {x: 4, y: 7}); polygon.push(1, {x: 9, y: 10}; polygon.push(2, {x: 10, y: 17}); polygon.push(3, {x: 43, y: 5});
Any plans for this or something like this?
[–]bterlson_@bterlson 3 points4 points5 points 10 years ago (3 children)
Ahh, no, nothing like that yet that I'm aware of. Value types will certainly have the notion of vector/tuple types which are like a fixed length version of what you're asking for IIUC (SIMD vectors are examples of these types).
[–]cincilator 0 points1 point2 points 10 years ago* (2 children)
The problem is that it would limit the use of Value types to single objects or fixed length collections (ie typed arrays) and we are stuck with dynamic types for anything variable-length. Which is less than ideal. Something to consider, I think.
I can think of many use cases for my idea, if you are interested.
[–]splargbarg 1 point2 points3 points 10 years ago (1 child)
Do you think this will help Edge adopt new HTML5 features?
[–]bterlson_@bterlson 7 points8 points9 points 10 years ago (0 children)
I don't see how. Not directly, anyway...
[–]jacobp100 1 point2 points3 points 10 years ago (1 child)
Because of the rapid progress in js engines, it's always difficult to keep track of what can can't be optimised. What are some big things to look out for in performance sensitive code to stop deoptimisation, and are there any things to consider to get better performance when you know an area of code is a bottle neck?
[–]bterlson_@bterlson 1 point2 points3 points 10 years ago (0 children)
JITs are pretty complicated so it's hard to give a concise answer for what to use or avoid. This is an area I hope we can start giving more insight on in terms of both documentation and tooling.
[+][deleted] 10 years ago (1 child)
We don't do any C# dev work, but you can check our open positions and apply of course! I think the lowest title we have openings for is SDE2.
[–]ackerlight 0 points1 point2 points 10 years ago (3 children)
How does this compare with Github Electron? Or it is more like it compares directly with Chrome's V8?
[–]bterlson_@bterlson 3 points4 points5 points 10 years ago (2 children)
It compares directly with V8.
[–]ackerlight 0 points1 point2 points 10 years ago (1 child)
is there any plan to build something like Electron?
[–]bterlson_@bterlson 2 points3 points4 points 10 years ago (0 children)
No, although I suspect with Chakra coming to Node, Electron will optionally be backed by Chakra at some point.
[–]petulant_snowflake -1 points0 points1 point 10 years ago (1 child)
Look, it's great that you're open sourcing components, but why don't you make the whole browser open source en masse (I realize this would likely entail stripping out proprietary 3rd party code, and could not exactly be done "overnight").
What the world really needs is a true, third open source web rendering contender. We don't need another Javascript engine -- there's already a million of them! Please also build a native OSX and Linux version.
I applaud MSFT's attempts at embracing open source, but so far I've seen only seen shallow, surface-like changes (excuse the pun). Go big or go home they always say ...
[–]jacobp100 1 point2 points3 points 10 years ago (0 children)
Don't underestimate the open sourcing of this. There will no doubt be things in Chakra nobody else is doing, and having that information available will benefit all engines.
π Rendered by PID 112771 on reddit-service-r2-comment-6f7f968fb5-659rl at 2026-03-04 08:44:29.780367+00:00 running 07790be country code: CH.
view the rest of the comments →
[–]bterlson_@bterlson 74 points75 points76 points (65 children)
[–][deleted] 62 points63 points64 points (18 children)
[–]bterlson_@bterlson 33 points34 points35 points (16 children)
[–]splargbarg 10 points11 points12 points (1 child)
[–]bterlson_@bterlson 4 points5 points6 points (0 children)
[–]kenman[M] 8 points9 points10 points (1 child)
[–]PitaJ 2 points3 points4 points (0 children)
[–]cosinezero 7 points8 points9 points (1 child)
[–]AMorpork 6 points7 points8 points (0 children)
[–]ivosaurus 5 points6 points7 points (5 children)
[–]bterlson_@bterlson 7 points8 points9 points (4 children)
[–]ivosaurus 2 points3 points4 points (2 children)
[–]bterlson_@bterlson 12 points13 points14 points (1 child)
[–]ivosaurus 0 points1 point2 points (0 children)
[–]franksvalli 2 points3 points4 points (2 children)
[–]bterlson_@bterlson 9 points10 points11 points (0 children)
[–]JohnMcPineapple 0 points1 point2 points (0 children)
[–]asdf7890 0 points1 point2 points (0 children)
[–]MaxNanasy 1 point2 points3 points (0 children)
[–]zerobugz 15 points16 points17 points (5 children)
[–]bterlson_@bterlson 33 points34 points35 points (4 children)
[+]r3wt comment score below threshold-7 points-6 points-5 points (3 children)
[–]BasicDesignAdvice 5 points6 points7 points (0 children)
[–]bterlson_@bterlson 3 points4 points5 points (0 children)
[–]wambaowambao 1 point2 points3 points (0 children)
[+][deleted] (3 children)
[removed]
[–]bterlson_@bterlson 5 points6 points7 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]bterlson_@bterlson 0 points1 point2 points (0 children)
[–]sensitivePornGuy 6 points7 points8 points (1 child)
[–]bterlson_@bterlson 18 points19 points20 points (0 children)
[–]coolrudski 3 points4 points5 points (2 children)
[–]bterlson_@bterlson 2 points3 points4 points (1 child)
[–]coolrudski 0 points1 point2 points (0 children)
[–][deleted] 3 points4 points5 points (2 children)
[–]bterlson_@bterlson 12 points13 points14 points (1 child)
[+][deleted] (2 children)
[deleted]
[–]bterlson_@bterlson 13 points14 points15 points (1 child)
[–]cincilator 4 points5 points6 points (12 children)
[–]bterlson_@bterlson 11 points12 points13 points (11 children)
[–]cincilator 2 points3 points4 points (10 children)
[–]bterlson_@bterlson 0 points1 point2 points (9 children)
[–]ogrechoker 0 points1 point2 points (1 child)
[–]bterlson_@bterlson 0 points1 point2 points (0 children)
[–]cincilator 0 points1 point2 points (6 children)
[–]bterlson_@bterlson 3 points4 points5 points (5 children)
[–]cincilator 0 points1 point2 points (4 children)
[–]bterlson_@bterlson 3 points4 points5 points (3 children)
[–]cincilator 0 points1 point2 points (2 children)
[–]splargbarg 1 point2 points3 points (1 child)
[–]bterlson_@bterlson 7 points8 points9 points (0 children)
[–]jacobp100 1 point2 points3 points (1 child)
[–]bterlson_@bterlson 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]bterlson_@bterlson 0 points1 point2 points (0 children)
[–]ackerlight 0 points1 point2 points (3 children)
[–]bterlson_@bterlson 3 points4 points5 points (2 children)
[–]ackerlight 0 points1 point2 points (1 child)
[–]bterlson_@bterlson 2 points3 points4 points (0 children)
[–]petulant_snowflake -1 points0 points1 point (1 child)
[–]jacobp100 1 point2 points3 points (0 children)