If you come up with a benchmark for this, would you mind sharing the code
and not just the results? I'm curious how my stuff will fare.
I'm in an environment where it is still not practical to use ES modules,
and have started work again on BravoJS, which implements the old CommonJS
Modules/2.0
As a data point -- I was writing JavaScript applications with GPSEE, a
server-side Spidermonkey embedding, for several years until recently. The
design pattern was, for all intents and purposes, CGI.
GPSEE has E4X capability. I used it a few times to generate xhtml
documents. I never found a
We still use ES5 for development, since our server-side platform (GPSEE)
doesn't run on later SpiderMonkey (embedding API made massive changes a
couple of years ago and we haven't had resources to update.massive
changes)
I am working closely with another company right now that uses NodeJS.
On 27 October 2017 at 01:48, kai zhu wrote:
> es6 is essentially javascript++, like c/c++. you can't expect senior
> c programmers to trivially transition projects to c++, or for existing
> c toolings to automatically extend to c++.
>
>
Really? I was in that particular
In gpsee (using spidermonkey), we allow executable programs exactly the
same way as a shell script, and there is no real penalty from a JavaScript
parsing POV. I'm not sure why node+v8 would be any different. We just
hand over the script to the parser with the pointer pointing to the newline
at
If anybody wants to play with MT ES (I'm not saying I think this is a good
idea) -- you might want to dig up a ~ten-year old version of Spidermonkey,
perhaps the JS 1.7 release (MT "safety" broke with Array Extras). Then
add this code, which implements a basic Thread class:
There is no requirement for a host environment to use any kind of
serialization for worker threads. It's completely fine to pass messages
which are binary in nature. In fact, I have passed C structs as messages
between JavaScript workers.
I don't know why you think this is a fight. You should
Please do. I have also done some work in this area. I have also
implemented asynchronous POSIX signals (fraught with peril) and fork().
Entertaining stuff.
My major problem has always been entrainment of crap from the global
object. Although it has been a few years since I looked at this
I'm still confused about what problem we are trying to solve here.
I had pthreads-style JS running in JS 1.7 many years ago (
https://github.com/wesgarland/gpsee/tree/master/modules/thread), and after
investing quite a lot of time in making it work, I found that it wasn't
really all that useful
How often do you type const in a day?
Saving 2 characters will save you 250ms assuming you are a decent
keyboardist.
I'll trade 250ms of typing for clarity any day.
Wes
Sent from my iPhone
On Aug 28, 2016, at 08:00, Cyril Auburtin wrote:
After a year of using
That root post ignored compatibility constraints that have been discussed to
death over the years, and just glibly asserted that == and === could be
changed.
The last time == and === were changed (JS 1.1-1.2-1.3) I was a pretty
green developer building a very large DHTML application. I lost
Some food for thought from a non-standard use-case.
In GPSEE, we can require(module) - but we support both modules written in
JavaScript, and modules written in C (technically, any compiled binary with
the correct C API), or both. We dlload(module.so) (if present), then
interpret module.js (if
Some interesting questions here.
1 - What is a character? Is it a Unicode Code Point?
2 - Should we be able to match all possible JS Strings?
3 - Should we be able to match all possible Unicode Strings?
4 - What do we do if there is a character in a String we cannot match?
5 - Do unmatchable
The specification is hard enough to digest for average developers now;
I'd hate to point one of my guys at a machine-readable document when
he's having trouble with some corner-case.
___
es-discuss mailing list
es-discuss@mozilla.org
On 22 March 2013 08:41, gaz Heyes gazhe...@gmail.com wrote:
You wouldn't do that, you'd point them to the human readable form. The
machine version is specifically designed to be read by machines with low
overhead to update functionality without touching code.
Is there a formalized way to
You did not include variants of
var i, a=[];
for (i=0; i 10; i++) {
a.push(print(i));
}
print(a[3]); /* output is 9 */
in your list. I see related bugs on a regular basis.
The other place I see regular bugs by intermediate coders is related to
'this' in events; but I'm not sure if we can
Arguments object is used here to fill the rest void, but also as an
argument to apply (after converting into a real array) when writing wrapper
functions; eg monkey patches, userspace profiling, etc.
Is there an ES6 way to use apply on rest params? If not, arguments must
live on.
Sent from my
On 24 July 2012 05:03, Claus Reinke claus.rei...@talk21.com wrote:
Hm, I hadn't thought about that, but my intuition tells me that
there should be an export object for every module, with just the
exports, and that this export object should be accessible from the module
object.
Being able to
On 5 July 2012 11:19, Patrik Stutz patrik.st...@gmail.com wrote:
Oh I didn't know that Isaac is also unhappy with the whole javascript
module thing. I tought that, since there already so much modules for
node.js it is pointless to ask them to change their module system, so that
node modules
On 27 June 2012 15:45, Kevin Smith khs4...@gmail.com wrote:
By implementing it in SpiderMonkey! :)
That's cheating! : )
A social note: designing the module system for ES6 is a difficult
position to be in because there's already a more or less de facto module
system in place (derived
On 27 June 2012 17:21, Sam Tobin-Hochstadt sa...@ccs.neu.edu wrote:
Certainly you shouldn't have to create a userland loader in order to
get examples like I've written to work. You should only ever need to
create a loader if you want to customize things, such as redirecting
some things to
On 27 June 2012 17:40, Sam Tobin-Hochstadt sa...@ccs.neu.edu wrote:
What request do you send to ask for multiple modules?
We send a request like
/methods/modules?root=pathto/mystuffid=/sha256id=/auth/password
The client canonicalizes each CommonJS dependency to its full (canonical)
path and
On 26 June 2012 16:45, Kevin Smith khs4...@gmail.com wrote:
Hi Isaac,
I share some of your concerns as well. I like the idea of import just
returning an object, which can be destructured using let. I also like the
idea of eliminating the import * syntax. However, I think that dynamic
On 26 June 2012 18:36, Aymeric Vitte vitteayme...@gmail.com wrote:
Node.js's way is good, except the transitive dependency issue mentioned
in your post which in some cases indeed can cause problems.
Does Node not handle transitive dependencies per CommonJS Modules/1.0?
What I find bad (1)
Yes, we could make ?? and ??= do the same for null as for undefined. I'm
not sure that's
the right choice, but it's a choice.
Introducing yet another way to think about values in ES is not going to
help most programmers. We already have to think about thinks like
undefined and falsey -- what's
On 13 June 2012 03:45, T.J. Crowder t...@crowdersoftware.com wrote:
Is the reason for using ?: rather than ?? because we may want it for my
desired second ternary? E.g., from my other message:
Something else to consider; if we use (a ?: b), it would have to be
equivalent to (a ? a : b) with
This breaks from JS's C-inspired assignment operators, but perhaps we can
live with it.
FWIW -- I was confused when I first read ||=, I thought it was supposed to
be some kind of Boolean-coercing variant on |=. Now I see that it is more
like ?= from GNU make.
What do you think of GCC's ?:
error.stackFrames, an Array which contains one object per stack frame,
describing function name (if any), filename, line number, some kind of
instance Id (for closures), arguments, and closed-over variables would
be absolutely incredible from my POV.
Tie it up in a nice package that can be
It might be out of scope, but as a developer, I would almost give my left
nut to have the kind of information in Brendan's example.
Even more so if it the browser guys made it available as an argument to the
window.onerror callback.
Wes
--
Wesley W. Garland
Director, Product Development
On 22 May 2012 12:54, Aymeric Vitte vitteayme...@gmail.com wrote:
I don't see how a FFI could really help developers.
FFIs are certainly helpful in many situations. I don't think this is one
of them.
Let me relay a relevant xperience. We develop applications in Server-Side
JavaScript. We
This thread brings up an interesting question:
Once we have modules, should we have a place other than ECMA-262 to define
standard host-environment libraries that ship with browsers?
On 21 May 2012 04:54, Jussi Kalliokoski jussi.kallioko...@gmail.com wrote:
On Sun, May 20, 2012 at 11:53 PM,
This reminds me of a different topic: foreign function interface.
[...]
Thoughts?
1. I'm not sure this belongs in ES
2. If TC-39 starts looking at this, I would like to contribute somehow. I
have significant experience in this area, and can share knowledge gleaned
from an ES-centric
On 13 May 2012 13:57, Brendan Eich bren...@mozilla.org wrote:
Protocols are fine and perhaps a new-free one will take over some years
hence, but not soon.
- Should there be alternate, possibly less confusing, ways of coercing
values? ToPrimitive() would certainly be nice to have.
An
It looks to me like this code would work just fine by removing the word
'typeof'. What am I missing?
On 8 May 2012 12:19, Rick Waldron waldron.r...@gmail.com wrote:
module Foo {
export function create( options ) {
if ( typeof options === null ) {
return ... some default thing;
On 12 April 2012 15:37, Allen Wirfs-Brock al...@wirfs-brock.com wrote:
Right chrome and safari log undefined in that case. FF and IE9 syntax
error out on the var declaration.
As long as we're exploring web compat, here's a historical view of
SpiderMonkey behaviour --
JS 1.8.5 (~ Firefox 4)
From a developer's POV - the terms bound/unbound makes a create deal of
sense, since already have bind, which effectively turns an unbound function
into a bound function. It basically completes the thought and makes it
easy to explain.
Heck, it even makes this behaviour easy to explain:
In a similar vein, I would personally like to have
zero-cost-when-not-debugging assert() statements, and am hopeful that
statically-linked modules might lead the way.
We currently have LOW cost assert() statements, but these are still not
suitable for hot loops. We can turn them into zero-cost
On 31 March 2012 21:30, David Herman dher...@mozilla.com wrote:
Yeah, I've thought about auto-appending .js. I think you're right that
it opens up the possibility to be a little more abstract.
FWIW -- the CommonJS convention of auto-appending .js has been a real boon
to us when writing GPSEE
On 1 April 2012 08:22, Wes Garland w...@page.ca wrote:
the JS application developer never needs to know what language the
application is written in.
Sorry, what language the *module* is written in.
Wes
--
Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102
We face basically this same problem in our day-to-day development -- here's
how we do it: food for thought
We use BravoJS as our module system, which targets CommonJS
Modules/2.0-draft 8 (not an officially endorsed standard). From the
ten-mile-POV, BravoJS works by loading the entire module
On 25 March 2012 03:07, Axel Rauschmayer a...@rauschma.de wrote:
One thing that would be nice that we don't currently have is the ability
to load modules relative to the calling web page. This is an oversight in
our loader.
I'm curious: What is the use case for that?
The case where you
On 23 March 2012 21:59, Irakli Gozalishvili rfo...@gmail.com wrote:
A. ./foo.js ../foo/bar.js
B. foo.js, foo/bar.js
I'd suggest to resolve A type paths relative to a requirer (ether require
module url, or document url). And resolve B
type paths relative to a `document.baseURI`.
This is
On 24 March 2012 17:22, David Herman dher...@mozilla.com wrote:
I'm not 100% clear on this point yet, but e.g. the SourceCharacter
production in Annex A.1 is described as any Unicode code unit.
Ugh, IMHO, that's wrong, and should be any Unicode code point. (let the
flames begin?)
The
On 1 March 2012 19:34, Allen Wirfs-Brock al...@wirfs-brock.com wrote:
What do you think? Do you like - better than | ? Is it ok to not have
it available for functions?
I am always reticent to re-use lexical features of one language when
implementing in another with wildly different
What about native JSON loading?
How would this be different from XHR + JSON.parse() sugar?
Are you proposing loading the JSON from the server as though it were a
module?
FWIW, most of my JSON-loading use cases are post-page-load, they are of the
fetch some data from the server based on user
Mozilla used to support something like this, it is being removed in Firefox
12, but perhaps the implementation can give you ideas.
https://developer.mozilla.org/en/Sharp_variables_in_JavaScript
Wes
On 5 March 2012 07:49, Andreas Rossberg rossb...@google.com wrote:
On 5 March 2012 13:35, 程劭非
Can we really add a Bit namespace without breaking the web? Maybe
Math.Bit if we really want a bitwise operation namespace?
clz, clo, the names are cryptic but so are their applications -- so I think
it's a good fit. zLen and oLen might also make good names.
These could be handy for other
Erratum:
var a = [0];
should read
var a = [];
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
On 21 February 2012 00:03, Brendan Eich bren...@mozilla.com wrote:
These are byte-based enodings, no? What is the problem inflating them by
zero extension to 16 bits now (or 21 bits in the future)? You can't make an
invalid Unicode character from a byte value.
One of my examples, GB 18030,
On 20 February 2012 00:45, Allen Wirfs-Brock al...@wirfs-brock.com wrote:
2) Allow invalid unicode characters in strings, and preserve them over
concatenation – (\uD800 + \uDC00).length == 2.
I think 2) is the only reasonable alternative.
I think so, too -- especially as any sequence of
On 19 February 2012 16:34, Brendan Eich bren...@mozilla.com wrote:
Wes Garland wrote:
Is there a proposal for interaction with JSON?
From http://www.ietf.org/rfc/rfc4627, 2.5
*snip* - so the proposal is to keep encoding JSON in UTF-16. What happens
if the BRS is set to Unicode and we
On 20 February 2012 09:56, Andrew Oakley and...@ado.is-a-geek.net wrote:
While this is being discussed, for any new string handling I think we
should make any invalid strings (according to the rules in Unicode)
cause some kind of exception on creation.
Can you clarify which definition in
On 20 February 2012 16:00, Allen Wirfs-Brock al...@wirfs-brock.com wrote:
My sense is that there are a fairly large variety of string data types
could be use the existing ES5 string type as a target type and for which
many of the String.prototuype.* methods would function just fine The
On 19 February 2012 03:33, Brendan Eich bren...@mozilla.com wrote:
S1 dates from when Unicode fit in 16 bits, and in those days, nickels had
pictures of bumblebees on 'em (Gimme five bees for a quarter, you'd say
;-).
Say, is that an onion on your belt?
* indexing by characters, not
There's both room and need for a built-in assert() IMHO -- I would like one
which magically compiles to nothing in production code.
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
On 30 January 2012 11:56, Allen Wirfs-Brock al...@wirfs-brock.com wrote:
this was part of what I was trying to get at in using the phrase
application level semantics. The distinction really isn't very different
from object created via object literals (or any other standard mechanism).
They
Why wouldn't you just fix this at the HTTP level with
Content-Transfer-Encoding negotiation of some sort?
Out of curiosity, what are you sending to the server that that requires
additional compression? Remember that zlib is not useful on PNG, JPEG, etc
content.
Wes
--
Wesley W. Garland
On 28 January 2012 22:51, Mark S. Miller erig...@google.com wrote:
Just because an object is provided as part of the host environment does
*not* make it a host object. Given your statements above, I suspect that
the Node objects you have in mind are all simply native objects provided by
the
On 22 January 2012 16:05, Jake Verbaten rayn...@gmail.com wrote:
The idea here is that methods do not belong in data structures (clone
should be to efficiently clone data).
Method vs. Property is a false dichotomy in functional languages, IMO. A
method is merely a property whose value is a
On 20 January 2012 09:22, Herby Vojčík he...@mailbox.sk wrote:
+1. I see no point why let e; should not shadow argument e here.
I do. It is a virtual certainty that this form was used accidentally by
the developer, which indicates a flaw in the developer's thinking --
probably due to
On 19 January 2012 23:02, Brendan Eich bren...@mozilla.org wrote:
Yes kids, this means we are going with MarkM's lambda desugaring from:
https://mail.mozilla.org/**pipermail/es-discuss/2008-**October/007819.htmlhttps://mail.mozilla.org/pipermail/es-discuss/2008-October/007819.html
So any
Object.classOf(x) - Object.prototype.toString.call
(x).slice(8, -1) using the original value of O.p.toString.
Comments?
Including the name of the module that the class comes from might be nice.
We do that for classes implemented in C in GPSEE modules today by being bad
-- we modify
On 16 January 2012 14:20, Andrea Giammarchi andrea.giammar...@gmail.comwrote:
var module = require(module);
is totally fine but
require(module, function (module) {
// is totally fine too
});
latter could be synchronous in node.js and asynchronous in the web, who
cares, as long as it
On 17 January 2012 13:05, Russell Leggett russell.legg...@gmail.com wrote:
After all, e4x is just an extension to JS, it should be possible to add
the data types natively and then make any e4x code work as syntactic sugar,
which you can desugar yourself.
I don't really know the details, but
I'll chime in with my vote - I would LOVE to be able to use octal literals
again in GPSEE for setting file permissions.
chmod(filename, parseInt(777, 8))
just looks stupid when chmod(filename, 0777) would work just fine.
Wes
On 12 January 2012 14:11, Brendan Eich bren...@mozilla.com
On 6 October 2011 14:09, Tom Schuster t...@schuster.me wrote:
(1) is in fact really good optimized in modern engines. (In case you
are interested search for Ropes: an alternative to strings)
You don't even need ropes to make this fast for a lot of common cases. I
think even a naive
Andrea;
On 17 September 2011 04:12, Andrea Giammarchi
andrea.giammar...@gmail.comwrote:
I know current Mozilla implementation is not exactly what will be in
JS.next but it was the only way I had to test efficiency of this proposal
and performances speaking it looks like an epic fail so far
Speaking pragmatically, for myself and my unusual (server-side) environment:
On 13 September 2011 10:48, Brendan Eich bren...@mozilla.com wrote:
Does JS need to be as fast as Java? Would half as fast be enough?
If it's compute-bound then that's plenty.
Provided we develop so that we can
Great post, Allen!
On 13 September 2011 15:01, Allen Wirfs-Brock al...@wirfs-brock.com wrote:
We need to do the same thing with our JS tools. All of the great dynamic
language IDEs (that, BTW, preceded and largely inspired the modern static
language IDEs) were live environments. They
On 12 September 2011 16:31, François REMY fremycompany_...@yahoo.fr wrote:
JavaScript is simple for the developer, but sometimes its flexibility makes
it impossible to optimize code properly. And it makes JavaScript slower.
I made this graph earlier this year, coincident with the Firefox 4
On 9 September 2011 16:06, Rick Waldron waldron.r...@gmail.com wrote:
I was actually very specifically looking for an answer regarding First
letter casing for non-constructor built-in objects, ie. Math and Proxy. I
think the legacy Java style guide influence addresses the question as best
as
On 16 May 2011 17:42, Boris Zbarsky bzbar...@mit.edu wrote:
On 5/16/11 4:38 PM, Wes Garland wrote:
Two great things about strings composed of Unicode code points:
...
If though this is a breaking change from ES-5, I support it
whole-heartedly but I expect breakage to be very limited
On 17 May 2011 12:36, Boris Zbarsky bzbar...@mit.edu wrote:
Not quite: code points D800-DFFF are reserved code points which are not
representable with UTF-16.
Nor with any other Unicode encoding, really. They don't represent, on
their own, Unicode characters.
Right - but they are still
On 17 May 2011 14:39, Boris Zbarsky bzbar...@mit.edu wrote:
On 5/17/11 2:12 PM, Wes Garland wrote:
That said, you can encode these code points with utf-8; for example,
0xdc08 becomes 0xed 0xb0 0x88.
By the same argument, you can encode them in UTF-16. The byte sequence
above is not valid
On 17 May 2011 15:00, Phillips, Addison addi...@lab126.com wrote:
2. Allowing unpaired surrogates is a *requirement*. Yes, such a string is
ill-formed, but there are too many cases in which one might wish to have
such broken strings for scripting purposes.
3. We should have escape syntax for
On 17 May 2011 16:03, Boris Zbarsky bzbar...@mit.edu wrote:
On 5/17/11 3:29 PM, Wes Garland wrote:
The problem is that UTF-16 cannot represent
all possible code points.
My point is that neither can UTF-8. Can you name an encoding that _can_
represent the surrogate-range codepoints?
UTF
On 17 May 2011 20:09, Boris Zbarsky bzbar...@mit.edu wrote:
On 5/17/11 5:24 PM, Wes Garland wrote:
Okay, I think we have to agree to disagree here. I believe my reading of
the spec is correct.
Sorry, but no... how much more clear can the spec get?
In the past, I have read it thus
Mark;
Are you Dr. *Mark E. Davis* (born September 13, 1952 (age 58)), co-founder
of the Unicode http://en.wikipedia.org/wiki/Unicode project and the
president of the Unicode
Consortiumhttp://en.wikipedia.org/wiki/Unicode_Consortiumsince its
incorporation in 1991?
(If so, uh, thanks for giving me
Allen;
Thanks for putting this together. We use Unicode data extensively in both
our web and server-side applications, and being forced to deal with UTF-16
surrogate pair directly -- rather than letting the String implementation
deal with them -- is a constant source of mild pain. At first
On 17 April 2011 20:09, Garrett Smith dhtmlkitc...@gmail.com wrote:
Function.prototype.toString says yes.
That's not a really valid evaluation IMO. At least in mozilla's case, the
semi colon appears in this by virtue of the bytecode decompiler putting a
semicolon at the end of every statement.
On Sat, Apr 9, 2011 at 12:47 PM, David Herman dher...@mozilla.com wrote:
When people say Tennent's correspondence principle to mean something like
beta-conversion is semantics-preserving I believe this post is where they
got the impression that it has to do with Tennent. For better or worse,
On Sat, Mar 26, 2011 at 10:44 PM, Brendan Eich bren...@mozilla.com wrote:
This es-discuss group sounds exactly like that ES Tech group -- why make
a new one?
I've always considered this group to be about super-fine nit-picky points of
ES, clarifications about recent changes, and well-thought
On Sat, Mar 26, 2011 at 2:33 AM, Brendan Eich bren...@mozilla.com wrote:
On Mar 25, 2011, at 8:45 PM, David Foley wrote:
My response was simply this : assuming normative scope in conversational
tone, that I would welcome is a venue where
end users (engineers and architects as well as
On Sun, Mar 20, 2011 at 6:03 AM, Jorge jo...@jorgechamorro.com wrote:
will eventually fire g() before f() is nodejs:
https://github.com/joyent/node/pull/604
I've never seen that in any browser.
This sounds like a bug in Node's clamping algorithm.
Wes
--
Wesley W. Garland
Director,
It doesn't, so we're going to need a non-clamping alias. Perhaps an [ugly]
setTimeout ( ƒ, -1 ) ?
I posit that the clamping behaviour and timer resolution are domain-specific
(embedding-specific) implementation details. Browser makers have been able
to deal with run-away CPU scripts, even the
On Sat, Mar 19, 2011 at 12:58 PM, Mark S. Miller erig...@google.com wrote:
The idea is not stupid at all. It's perfectly sound. For example, the delay
example you noticed could be made primitive and setTimeout built out of
that. Either can be built from the other. The advantage of layering
Kyle;
On Fri, Mar 18, 2011 at 11:53 PM, Kyle Simpson get...@gmail.com wrote:
Speaking as someone who has written and currently maintains a *synchronous*
server-side JavaScript environment (based on V8),
I resemble this description, except that my platform is built on
SpiderMonkey rather than
On Fri, Mar 11, 2011 at 10:07 AM, Claus Reinke claus.rei...@talk21.comwrote:
I believe it is very very important that the ECMAScript standard specify
that when a new Object is created, for..in iteration traverses properties in
the order they are added, regardless of whether the properties are
I bumped into something this morning that I thought might be worth pointing
out -- mostly because I was surprised to have seemingly-valid ES3 code break
on an ES5 browser without strict mode in play.
One of my developers has a habit of writing tests like
if (!hasOwnProperty(console))
//
Or am I missing something?
Yes -- programmers do all kinds of crazy and unexpected things. :)
Wes
--
Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102
___
es-discuss mailing list
es-discuss@mozilla.org
On Wed, Jan 26, 2011 at 5:04 PM, Brendan Eich bren...@mozilla.com wrote:
CommonJS may do that on the server side, assuming fast enough file i/o.
It's not necessarily a good idea even there (Ryan Dahl has talked about
this). On the client, it's right out, which is why client-side CommonJS-like
On Thu, Jan 20, 2011 at 8:25 PM, Brendan Eich bren...@mozilla.com wrote:
This is the killer for me. Do not want to change === and require all-paths
runtime test coverage to migrate code into Harmony.
You're bang-on about the end user impact of this change - I would not be
able to migrate any
Precedent and developer conversations I've had strongly suggest that some
code wants mutable primordials on the inside of a module that can be
consumed without the mutations affecting the importer's primordials.
It would be *really* interesting to have module-local prototypes -- and not
93 matches
Mail list logo