Comments (3)
I wrote this issue up rather quickly yesterday, and today I'm feeling paranoid that it reads as rather blunt/abrupt, or that I'm expecting you to do something. I'm not expecting anything, just trying to be helpful - apologies if the original description doesn't come across that way. :-)
from scalajs-benchmark.
Hi! Firstly thank you for the clarification message. I've no problem with your original but I really appreciate the kindness and know exactly what you mean in feeling how you felt. Text always seems to be a bit more ambiguous without a tone of voice bundled with it.
Unfortunately I don't have the time to spend making a nice getting started guide (at least for a while). I was kind of hoping that having the real working demo project and the examples in the readme would be enough, but I can see how that actually relies on quite a bit of implicit knowledge.
Which is a perfect segue to the issue you're seeing and the questions you're asking about. The implicit knowledge required there is pure Scala.js knowledge, and not scalajs-benchmark specific. I think you'd have the same problems with any other lilbrary... which I'm sure provides exactly zero comfort to you now haha. Let me do my best:
How to run it - I went for fastOptJS and a local http server but is that right?
There's no One Way for running Scala.js stuff. For short and sweet projects like this demo (and the scalajs-react ghpages site for another example), I just have a few static html files, and a little python server to serve both those files and the Scala.js-generated JS files. For larger projects I use something like http4s, or even a servlet + Jetty. There are some sbt plugins to make it nice and pleasant, (sbt-revolver
is simple and awesome, for example).
It doesn't mention @JSExportTopLevel("main") - I should have known about that one but I still tripped over it.
Yeah you've got to expose some kind of function, which you then call from a little inline <script>
tag in your html. Scala.js used to have the ability to add a little code to your generated JS, so that it calls your function as well; I just can't remember if that's still present or it's been removed. Either way, I personally don't use it but it's probably an option!
Should I be exporting modules? The HTML file examples suggest not?
Nah no need to export a module. You're gonna laugh when I tell you this but I think the problem you're having is that your def main
is asking for a Array[String]
, where as when you call it from your html, you're calling main()
, which is like calling main(undefined)
😅. Try using def main(): Unit
instead and I think you'll be in business.
Now all of that aside, not to be rude or anything but I've got tons on so I can be a bit infrequent in checking in on OSS issues. If you don't mind a delay then np, but you'd be able to get immediate feedback if you check out the Scala.js gitter. From what I've seen they're pretty nice and friendly, and pretty quick to respond too.
I hope that helps!
from scalajs-benchmark.
Hi,
There were two problems:
- As you said, calling main() with the wrong args.
- Requires the inclusion of the charts lib.
I've submitted a PR for your consideration that may help the next person: #229
Thanks again,
Dave
from scalajs-benchmark.
Related Issues (20)
- Wrong mode is serialized to JMH JSON when OpsPerSec is selected
- Suboptimal layout of bars in some charts HOT 1
- Benchmarking `async` functions? HOT 9
- AsyncEffectShootout with MacrotaskExecutor HOT 5
- 10x times difference in results between online and file accesed benchmark page
- Division by 0 error during deselection of all benchmarks on the batch mode page
- Remove blank lines from JMH JSON
- Log {fast,full}OptJS info to JMH JSON HOT 1
- Remove blanks from param names in JMH JSON
- Unexpected linker error with JDK 8 HOT 13
- Too big values in ops/s error column HOT 6
- Switch to ops/s as the main score metric in JMH JSON wanted HOT 4
- Log10 scale option for the main score wanted HOT 1
- Allow modification of EngineOptions in batch mode
- Add query params
- Wrong conversion to hours and days HOT 1
- Saving batch results to one file wanted HOT 3
- The Batch mode serializes benchmarks of suites in a random order HOT 2
- Include folder name in output filename by default
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scalajs-benchmark.