Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
disnet
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
disnet
12y ago
> I'm starting to wonder whether readtables would also allow all of TypeScript to be compiled with sweetjs. I haven't tried yet but I think all the syntax forms in TypeScript can be handled with just plain sweet.js macros, no n
2.
▲
by
disnet
13y ago
We're working on integrating macros and modules to address this. Once it's implemented you'll be able to do something like `import { m } from "macros.js"`.
3.
▲
by
disnet
13y ago
Actually sweet.js just landed infix macros [1] so you can match on syntax that comes before the macro name. This just happened last week so we haven't updated the docs or made an official release just yet. [1] https://github
4.
▲
by
disnet
13y ago
Yes indeed. Sweet.js already uses syntax objects internally so the groundwork is there for syntax-case. We "just" need to implement and surface the API :)
5.
▲
by
disnet
14y ago
> The macro syntax is definitely not simple, and it could possibly get really complex for more elaborate syntactic definitions, thus rendering the source much less readable. True, but the same can be said of any API. Reading the definit
6.
▲
by
disnet
14y ago
Thanks for taking the time to write these up! I'm tracking them here [1]. The first two should be fixed and I should have the third ready soon. [1] https://github.com/mozilla/sweet.js/issues/18
7.
▲
by
disnet
14y ago
> OK, either your description page doesn't get your point across at all, or you're missing a definition somewhere. The description page (like the rest of the project at them moment) is definitely a work in process. Sorry about the confu
8.
▲
by
disnet
14y ago
Yeah there are certainly a few bugs remaining in the reader :) It actually does the right thing if the function is named: a = function foo() {} /5/ 7 correctly translates to: a = function foo() { } / 42 / 7; Bu
9.
▲
by
disnet
15y ago
I've found the path of least resistance is to not change the default keybindings of the various emacs packages. Use the vi bindings for text manipulation and when you need to invoke a package function it's back to the ctr/meta chords. It's
10.
▲
by
disnet
15y ago
Yep, but I managed with viper and vimpulse [1] which give vim bindings in emacs. You can have your cake and eat it too :) [1] http://www.emacswiki.org/emacs-es/Vimpulse
11.
▲
by
disnet
15y ago
Not sure if const/private are a good fit for contracts but things like "account balance is always positive" can be done right now with contracts.coffee using object invariants. For example, verifying the invariants of a binary search tree h
12.
▲
by
disnet
15y ago
MozRepl can give you a JS repl in emacs tied into the browser...no refresh required: https://github.com/bard/mozrepl/wiki
13.
▲
by
disnet
15y ago
I haven't done any benchmarks yet so not sure. In addition to the guards I think the use of Proxies will cause some slowdown. But you're right the JIT should be able to optimize most of those guards away (maybe even someday use the guards t
14.
▲
by
disnet
15y ago
> Indeed it would be. That said, CoffeeScript is a compiler of sorts. The fact that we have a compiler doesn't give us all that much. Adding types to a dynamic language (where things can be monkey patched, evaled, and just generally mut
15.
▲
by
disnet
15y ago
Well, CoffeeScript/JavaScript doesn't have a static type system. And to add one would be...hard. But we would still like to express and enforce some invariants about our code. And we'd like to do it in a more elegant way than constantly wri
16.
▲
by
disnet
15y ago
I'm not sure that the relationship between types and contracts is all that tenuous. They both work to enforce program invariants and there's a large overlap in the invariants they can express. Usually contracts are checked dynamically (as i
17.
▲
by
disnet
15y ago
It's a fork of CoffeeScript so it replaces your "coffee" executable. If you don't want to overwrite your normal CoffeeScript compiler just run the contracts.coffee "coffee" executable from its own directory. I mention this briefly towards t
18.
▲
by
disnet
17y ago
Well, the wave people have already said they're stopping development for IE and will just be forcing the chrome frame: http://googlewavedev.blogspot.com/2009/09/google-wave-in-int... As long as wave takes off it'll drive adoption.