Hacker Newsnew | comments | show | ask | jobs | submit | login

Ammonite http://lihaoyi.github.io/Ammonite/#Ammonite-Ops provides a similar thing for Scala

-----


I totally transcribed it by hand. The transcribed sources (http://lihaoyi.github.io/workbench-example-app/raytracer-opt...) are completely readable

-----


Here's a high resolution pre-computed verison, in case anyone wants to see it but doesn't want to wait for it to render

https://www.dropbox.com/s/pmg84wj0eufb3ur/Screenshot%202014-...

-----


you might like to add your benchmark to this: https://github.com/kidoman/rays

-----


It uses normal Scala `Future`s. You get two `ExecutionContext`s: `queued` and `runNow`. You can't block on a `Future`. That covers just about all the ScalaJS specific stuff, the rest is plain Scala.

Take a look at [Scala.Rx](https://github.com/lihaoyi/scala.rx) or [uTest](https://github.com/lihaoyi/utest) if you want to see code examples of how `Future`s are used in ScalaJS, but I think you'll be disappointed: it's exactly the same code that gets run on Scala-JVM!

-----


You said:

> You can't block on a `Future`

Which answers my question. Thank you.

But then you also said:

> it's exactly the same code that gets run on Scala-JVM

That can't be exactly true, since "Awaitable" [1] doesn't appear anywhere in the scala-js codebase. So I guess as long as you don't mention that trait by name, or attempt to block on a future, then your effectively duck-typed Scala-JVM code will be able to run unmodified on Scala-JS.

[1]: http://www.scala-lang.org/files/archive/nightly/docs/library...

-----


We've managed to get a hello world app down to about 300kb; most of that is the standard library, and even a several-1000-LOC game like [roll](http://lihaoyi.github.io/roll/) clocks in at about 340kb. Getting this number down is WIP.

-----


Fun demos using Scala.js:

http://lihaoyi.github.io/scala-js-games/ http://lihaoyi.github.io/scala-js-game-2/

The second one has some performance issues, and bugs out initially when first opened in FF (need to refresh before it works properly) but otherwise it's pretty fun =)

-----


Beyond 9000 is a (not very) obscure meme

Noted, we may change it, thanks

-----


Yeah; they are waaaay more hygienic than what we started with though. For example, it is incredibly easy to "get it wrong" trying to utilize these tools to make things hygienic, but in general that should cause the macros to fail pretty quickly (`NameError`) rather than continue working unhygienically, so you're not likely to accidentally capture anything. Not perfect, but not bad (for now)

It would be great if someone who actually knows what he's doing (e.g. a Scheme `syntax-XXX` expert) could chip in with help/advice on how to proceed.

-----


Hey All,

MacroPy is basically finished in its current state, as a proof of concept and bundle of demos. Next steps include breaking the macros themselves into separate project and polishing the core into a solid foundation for others to build upon.

We also very nicely wrote up and documented both the demo macros (case classes, pattern matching, etc.) as well as the macro writing process, so hopefully others will have an easy time getting into it

We welcome any feedback and contributions =D

-----


- Off-by-one errors should be security vulnerabilities, rather than just crashes

-----


Can't say I agree. You tend to find crashes pretty quickly. Security vulnerabilities tend to be found later in much more embarrassing ways.

-----


I'm pretty sure he was joking, in the same spirit as the comment one level up.

-----

More

Applications are open for YC Summer 2015

Guidelines | FAQ | Support | API | Lists | Bookmarklet | DMCA | Y Combinator | Apply | Contact

Search: