10 ms·
RunJS
- deleted 8y ago[deleted]
- BucketSort 8y agoWhy did you decide to make this as a standalone application instead of making it as a plugin to an existing editor? Seems like a lot of work for what seems to be a custom repl.
- Cieplak 8y agoGuessing it’s an Electron app, in which case it’s more along the lines of a desktop-packaged website.
- noir_lord 8y agoQuokka.js works nicely in vscode which means I'm only running one electron app not two (not that I care about electron memory usage, as long as the application feels fast I don't mind if it's 15Mb of memory or 150Mb, I have 32768 in my laptops and 65536 in my desktops).
- lol768 8y agoWhy's it Mac-only if it's Electron?
- coldtea 8y agoEven if it's Electron you still need to package a binary for each platform...
- tenryuu 8y agoDoes node not support cross compiling??
- codefined 8y agoIt does, but it takes effort and I believe that Windows compiling is hard work on Mac.
- ghego1 8y agoDepends on what you use to package. With electron packager (https://github.com/electron-userland/electron-packager https://github.com/electron-userland/electron-packager) it's really easy and fast to package on a Mac for Windows and Linux. The only real pain for multi-platform packaging is that you need to have a certificate both for Mac and Windows.
- statictype 8y agoIt's not hard at all to compile and build a package for Windows on Mac. On the other hand, want to add an icon to your Windows app from a Mac? Jump down the rabbit hole of installing Wine and other dependencies and watch it spend minutes trying to invoke rc-edit.exe on Mac to make it work.
- Nicksil 8y agoPrevious submissions this week: https://news.ycombinator.com/item?id=18832420 https://news.ycombinator.com/item?id=18832420 https://news.ycombinator.com/item?id=18841842 https://news.ycombinator.com/item?id=18841842
- ad_hominem 8y agoLooks like it didn't get any traction or comments previously and was posted by separate authors each time. So what's the point of providing these links? Are you gatekeeping people reposting things?
- Nicksil 8y ago> So what's the point of providing these links? Are you gatekeeping people reposting things? Why are you being so hostile?
- bdcravens 8y agoI didn't get hostility from the comment. I agree, only reason to link to previous submissions is when there was discussion.
- Nicksil 8y ago>I didn't get hostility from the comment. Jumping down my throat due to my otherwise benign comment is being hostile. Perhaps a conversation may take place next time; could even instruct me -- as you had here -- that "only reason to link to previous submissions is when there was discussion." Instead, asks leading questions, and some indirect accusation of gatekeeping. That's pretty far to take things based off a four word comment containing two URLs; you had to assume a lot in order to get that bent out of shape.
- ilrwbwrkhv 8y agodont put links from last time..
- tyingq 8y ago"RunJS will auto-evaluate your code as you type" Interesting. Is it in some kind of sandbox, or can I accidentally remove files, etc? Edit: Oh, it's an ios app?
- fareesh 8y agomacOS app
- josteink 8y agoWell that certainly makes it worthless to 90% here then.
- coldtea 8y agoMore like to 60% here. A shitload of devs use OS X -- and the platform has come quite high on the kind of HN crowds, more so than on the generic public (as is evident by the speakers and even attendants on most dev conferences).
- fareesh 8y agoIn my specific case (maybe my case is the majority, maybe not), I run macOS only because I want a no-nonsense laptop that just works. For the combination of good hardware, good display and good build quality, I found the Macbook Pro (2015ish) to be the best bet at the time, and it has served me well thus far. Prior to that I was using a very cheap but sturdy Samsung with Linux on it. On the Desktop I run Linux and Windows (only for Steam every now and then).
- arcticwombat 8y agoIt's not a MacOS app, it's an Electron app (So, just a web browser bundled to look like an app)
- tyingq 8y agoCompiled and available solely for MacOS, though. Odd.
- drinchev 8y agoThat's awesome. I have always wanted something like this. I was even looking for some sublime text plugins that evaluate code on the go, but was out of luck. Some use cases : - Coding interview - Stack Overflow answers playground - Instead of "node -pe ..."
- pault 8y agoThere are many vscode plugins that will evaluate code and display the results inline (the build in debugger does this too if you pause execution). You can find them pretty easily in the visual studio marketplace.
- antonkm 8y agoWhich one is your personal favorite?
- cjmoran 8y agoLight Table comes to mind: http://lighttable.com/ http://lighttable.com/
- GordonS 8y agoI generally use jsfiddle for these kind of things, but AFAIK it doesn't do es6 or Typescript, so RunJs looks like it's worth a try.
- GordonS 8y agoAh, didn't notice it was Mac only, which is a deal-breaker for me. Also kind of odd for an Electron app.
- castis 8y agoBeing an electron app, Im surprised it only consumed 150 mb of ram and spawned 4 processes just by opening it.
- andremendes 8y agoIs it a good number for Electron apps? Is it ok nowadays? 150MB seems too much for me. I also thought that by using Electron an app would be readily portable but I could only find Mac binaries.
- ronsor 8y ago150MB is really good for an Electron app
- andyidsinga 8y agoyep - that's pretty minimal - about what I get when I'm just starting off with a skeletal electron app. for refernce, on win 10: whatsapp - 200+mb and 4 processes. slack - 325mb and 5 processes.
- devcpp 8y agoOh my God I thought he was kidding. How did it get to this? And how do we solve this?...
- coldtea 8y agoDon't use Electron apps?
- arcticwombat 8y agoHow did it get go this? Well that's what you get when the "solution" is to embed a webserver, a browser, a native executable to show that browser, and the server runs Node... The solution is simple, stop shoving square pegs in round holes, and learn an appropriate language rather than shoehorn JS everywhere.
- paulddraper 8y agoAh, JavaScript, only for Mac. What a weird world this is.
- peyloride 8y ago+1
- deleted 8y ago[deleted]
- filleokus 8y agoThis could be useful! I hate typing in some random chrome window for just testing out something super simple. It is however surprisingly slow to execute the code on my machine. At first I thought it was the auto run delay, but even when running it manually it takes ≈ 0.9 seconds. Not really a problem, but I expected it to be quicker.
- rc-1140 8y agoSo LINQpad but: - for Javascript - only for Mac - evaluates JS as you type ?
- rpeden 8y agoIt reminds me more of Light Table than LINQpad or RoslynPad.
- dangom 8y agoPretty cool. Only issue is not being able to exit from an infinite loop. let x = 2; for (let y=0; y < 10; x++){ console.log(x) } x
- wvenable 8y agoThe next feature should be detecting whether or not there is an infinite loop and warn you before running it.. /s
- deleted 8y ago[deleted]
- ClassyJacket 8y agoI know this is a joke about the halting problem, but some kinds of infinite loop can be detected.
- blondin 8y agoi like this idea so much. i wish the author the best of luck, i will be following development. some basic features are missing: autocompletion, in-editor help and documentation, and my own nitpicking favorite: font size!! -- i know, i know, there is that zoom in thing that seems to work sometimes... i grew up with environments like QBasic and TurboPascal. they had everything you needed to learn and master specific languages? all in one package. JavaScript is so lucky to have such easy integration with the electron stack. and with all the bad rap electron apps have been getting, this is just 160MB unzipped. the closest we have for Python is the mu editor. that editor is half a Gb unzipped!! also, could it be that adding more features and library would make the size go up? who knows? anyways, looks good.
- 3dfan 8y agoI was interested to try it. Clicked into the code 'Uhh.. this is ... an image?' Saw the 'DOWNLOAD RUNJS' button. Smiled. 'Download? That reminds me of the 80s where we traded software on floppy disks'. And I was reminded of... YOUR AMIGA IS ALIVE. BUT IT IS INFECTED BY A VIRUS. Thanks for the nostalgica. If you ever decide to make it available in the browser, I will try it.
- tolmasky 8y agoIf you would like a solution that works in the browser, you can try our project, https://runkit.com https://runkit.com. It gives you access to real node (every version), and already had every version of every package of npm pre-installed.
- coldtea 8y ago>I was interested to try it. Clicked into the code 'Uhh.. this is ... an image?' Saw the 'DOWNLOAD RUNJS' button. Smiled. 'Download? That reminds me of the 80s where we traded software on floppy disks'. This reminds me of before 2010, when we though web apps will eat the world. Have you been living under a rock? Mobile apps have taken over since where the action is (on mobile), and even on the desktop downloaded apps are doing just fine (even if some use web technologies like Electron).
- emmelaich 8y agoI had the opposite reaction - mine was 'thank god this is not yet another thing I have to be online for'
- Fudgel 8y agoSomewhat similar: https://github.com/princejwesley/Mancy https://github.com/princejwesley/Mancy
- fiberoptick 8y agoThe third demo screenshot [1], which contains a toy implementation of AES in CBC mode, is a great example of why cryptography is hard to get right. Implementation is best left to cryptographers. AES-CBC requires a random IV to be used as a nonce on a per-message basis, otherwise the entire scheme breaks. The toy example given on this website uses the deprecated Node.js createCipher [2] API which does not take such an IV. In fact, the docs and runtime even warn that using CBC mode with the createCipher API is dangerous! As the code is currently written, an attacker observing multiple encrypted messages under the same key could probably decrypt all messages! [1] https://projects.lukehaas.me/runjs/images/runjs3.png https://projects.lukehaas.me/runjs/images/runjs3.png [2] https://nodejs.org/api/crypto.html#crypto_crypto_createcipher_algorithm_password_options https://nodejs.org/api/crypto.html#crypto_crypto_createciphe...
- rubyn00bie 8y agoI totally understand why you're saying what you are, you want folks to be safe... but I think this approach from cyptographers hurts the rest of us, in that most of us will at some point say, as a result of comments like this, "I'm not a cryptographer, I cannot do this correctly... so fuck trying." I think critiquing this crypto used would be more relevant if he was implementing his own and not using using an outdated library. Instead of linking to proof about how right you are, since you obviously are, perhaps next time you could link to resources for us plebs to stay up-to-date. How do you keep tabs on "all the things" like this? /shrug just my two cents.
- barrkel 8y agoI think explaining why the crypto usage is wrong is useful, where a straight-up admonishment that someone is doing it wrong isn't. The principle here is explained, at least partially: if you don't use a random IV for every message, you're not secure. So if the API you're using doesn't let you specify the IV, or doesn't default to a random IV that leaves you with undecipherable blocks if you don't fetch its assigned value, you know it's wrong. It's good info.
- Waterluvian 8y ago
- snarfy 8y agoIt's all fun and games until you write out a destructive line of code.
- ehsankia 8y agoI don't know this, but Chrome DevTools' eager evaluation uses a pretty smart V8 internal tooling to figure out if your statement has a side effect, and only evaluates it if it does not. https://www.youtube.com/watch?v=GCOiVEQNmpQ https://www.youtube.com/watch?v=GCOiVEQNmpQ
- gavinpc 8y agoThis kind of as-you-type evaluator is extremely valuable to me. I've written a few tools to support this in emacs, and I use the JS one all the time.[0] I also wrote one for Graphviz (which outputs to an SVG buffer), and sometimes I'll put the output from the JS playground in `play-graphviz` mode so I can see real-time graph output from JS (by writing code to print dot graphs). ATM I don't know any other tools that can do that sort of thing, let alone compose independent ones to that end. Long live Emacs! [0] https://bitbucket.org/gavinpc/play-modes/src/default/js-play/js-play.el https://bitbucket.org/gavinpc/play-modes/src/default/js-play... (There is an odd bug in OSX where the first character of the input is eaten, so I always begin these "playgrounds" with "/// playing with <whatever>". There are some other oddities which I should document.)
- wootie512 8y agoLearning some JS to help out on a project. Having a good time playing around with this as I read through a JS intro book. Nice and easy to check things out as I work my way through code examples throughout book.
- sebringj 8y agoThank you, this seems very useful and much nicer than doing a jsfiddle as you can work locally. There's nothing wrong with reposting good work as I would have missed it otherwise. Bravo.
- simplify 8y agoAlso consider flems.io , a similar evaluate-as-you-type but for JS, HTML, and CSS.
- a_rahmanshah 8y agoIt's pinned in my dock! <3
- zaro 8y agoWhy is Nan === NaN; false considered a quirk? It works like so in every language I have ever used.