4 ms·
So ruby has a JS transpiler - opal - https://opalrb.com/ https://opalrb.com/ I tried using it a little bit but the reality is if you need JS to make your app m
by ativzzz 4y ago
So ruby has a JS transpiler - opal - https://opalrb.com/ https://opalrb.com/
I tried using it a little bit but the reality is if you need JS to make your app more interactable it's really worth it to just learn some JS. As soon as you need something complex the extra layer of abstraction just gets in the way and becomes more of a headache, and if you don't need anything complex then you don't need a fancy JS solution in the first place.
JS only becomes complex when you are trying to create an enterprise version of your app along with a build platform. You can always just sprinkle in <script> tags in your HTML for simple one liners without getting into the weeds.
- jrumbut 4y agoJS is complicated because the browser environment is complicated. If it's going to be rendered by and live in a web browser it will either be complicated or limited in some way (like low code/no code tools).
- DoesntMatter22 4y agoThat's not really true. It's complicated because the language is one of the worst to manage.
- eddsh1994 4y agoIt's not really any worse than Python or Ruby, but you also get TypeScript which helps
- FridgeSeal 4y agoI posit that it is both. Dealing with interactivity in the browser is subtle, complex and full of edge cases. JavaScript is also a horrible, broken language that’s not really fit for purpose. We’ve collectively invested a lot of time and resources trying to improve the experience of working with it, but the point still stands.
- deleted 4y ago[deleted]
- quechimba 4y agoI'm working on https://github.com/mayu-live/framework https://github.com/mayu-live/framework which is 100% server side Ruby. It's kinda like React/Preact, but server side, and Ruby. No JavaScript required (it's not even supported).
- ativzzz 4y agoThat's pretty neat. In general I think stuff like this is cool and works pretty well as a starter kit for simple CRUD apps if you don't already know Rails + JS, but like I said in my OP, once your app gets more complex, you hire some UX designers and you try to make your app more interactive, not having easy JS access makes it hard to do interesting things. So could be useful for small projects but I wouldn't pick a solution like this for projects I would want to grow larger
- DoesntMatter22 4y agoYou are assuming people use Opal because they don't want to learn JS. In reality it's that JS is a very messy language compared to ruby. You can be a lot more productive if you avoid JS entirely.
- ativzzz 4y agoJS is a totally fine language. The entire browser ecosystem makes JS an incredible productive language for working on the web. You can disagree if you don't like the language personally but that doesn't change the fact JS gets the job done
- DoesntMatter22 4y ago"incredible productive language for working on the web" You can disagree if you want but that doesn't change the fact that JS is a huge pain in the neck to get the job done with.
- 1337shadow 4y agoAbsolutely agreed, hence the many Python to JS transpilers out there. https://transcrypt.org https://transcrypt.org https://yourlabs.io/oss/ryzom#javascript https://yourlabs.io/oss/ryzom#javascript https://github.com/am230/py2js https://github.com/am230/py2js We get so much satisfaction out of writing JS in Python, it's worth all the IDEs in the world for us!