[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Does Ruby have any advantages over Python aside from being more hip?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 49
Thread images: 3
File: Ruby-language.png (47 KB, 446x512) Image search: [Google]
Ruby-language.png
47 KB, 446x512
Does Ruby have any advantages over Python aside from being more hip?
>>
>using interpreted languages for anything but scripting

Wew lad
>>
Ruby is going to get very fast soon.

http://jruby.org/bench9000/
>>
Web development is easier.
Sockets are more simple.
Not really and advantage, its just comfier to code in.
>>
>>53641564
>Web development is easier.
Python has Django and Flask, which are pretty much equivalent to Rails and Sinatra respectively.
>>
>>53640944
Matz is cuter than that autist that made python
>>
>>53641757
This is honestly the reason I choose ruby over python for my projects.
>>
>>53640944
They're pretty much the same.

Some people prefer python, others ruby.
>>
Ruby isn't as hip as Python anymore.
>>
>>53641889
In in web development it is still more hip. The hipness hierarchy goes something like

Elixir (possibly)
Go
Node
Clojure
Ruby
Python
maybe Scala
everything else
>>
>>53640944
Regex literals, better OOP through encapsulation with getters and setters, mixins, etc. Read https://www.ruby-lang.org/en/documentation/ruby-from-other-languages/to-ruby-from-python/.
>>
>>53640944
dont know specifically but it was way slower 3-4 years ago, also RoR and related frameworks were much more memory hungry than django or flask
>>
Ruby is less hip than python
>>
File: 1375537997208.gif (695 KB, 420x236) Image search: [Google]
1375537997208.gif
695 KB, 420x236
All the ruby hipsters moved to node.js. Then Go.
>>
>>53642048
I don't see why you'd want to use ANY of those for web dev. Except maybe node.

not that I'm that experienced, but for what purpose would you use something like ruby besides scripting?
>ruby on rails
but why?
>>
>>53642342
The idea behind using something like ruby on rails is it provides a common framework to build your next shitty web startup on. It also helps with recruiting new devs since there is essentially a market of people skilled in rails who can jump straight in and work on your shitty codebase with limited training compared to if you just wrote everything from scratch.
>>
Why is hosting with Rails so awful?
>>
>>53642342
What would you use?
>>
>>53642457
why would I need ruby to run a site/server/app to begin with?
Basic xampp setup. What else.
>>
>>53641889
>>53640993
>>53640944
This OP.

It's where Ruby is better than Python, since Python doesn't have the equivalent to mruby it needs.

>>53642139
Well, CRuby is on par with CPython, which still isn't impressive, but I take everything I get with those 90s ad hoc scripting thingies.

That said, Rails is still a bit slower than Django.
Also, you need to check the Ruby stack (like which application server you use etc) which is annoying.
>>
>>53642451
Because Ruby on Rails is a pain in the ass to install
>>
>>53642476
So you're a PHP dev? Let me put it this way, Rails is like Laravel or CakePHP but without the stuff you see on http://www.phpwtf.org/.
>>
>>53643644
Also, it's faster. Rails may be "slow" but it is still pure sanic next to PHP MVC frameworks.
>>
>>53643047
This to be desu.
Also, the documentation processors compiles the docs and that takes forever.

>>53643684
This, but it only shows the cost of Laravel and Symphony.
>>
>>53642591

What, like Micropython?

Or Kivy?
>>
>>53642591
>>53643895
If an embedded scripting language is what you need you might as well use Lua or Tcl.
>>
>>53643644
>>53643684
I don't see the use of all those examples. But then again I'm not a developer
>>
>>53643895
I first thought of micropython, too. But they seem to focus on making it work on microcontrollers, not on providing a sane C embedding API. Also, if there is a possibility, it doesn't seem documented.

Also, what the heck has a GUI framework to do with that.
>>53643938
Nice meme, but there are enough reasons not to prefer Lua and Tcl is something where the devs believed it could survive outside its original usage domain - commands.
>>
>>53644075
>not on providing a sane C embedding API
To continue:

Judging from

https://github.com/micropython/micropython/blob/master/unix/main.c

embedding the interpreter into applications is possible at all, but the API was clearly not made with this purpose in mind and I didn't check out how far the support for cross-language features goes.
>>
>>53644075
You are selling Tcl short. It works very well not just for commands but for longer scripts, too. It is trivially easy to embed and the C code is some of the best you will ever read. If nothing else, it is way more mature than mruby, so there's libraries and expertise available.
>>
>>53644192
>so there's libraries
That's the point.
There is no point in having extra libraries for an primarily headless, embedded interpreter.

Tcl is fine for 100 line scripts, but they shouldn't have gone the whole "b-buddy you can also create whole applications in it"-route.
Same applies to Python, btw.
>>
>>53644252
>There is no point in having extra libraries for an primarily headless, embedded interpreter.
Depends on what you're embedded it in and why. If you suddenly need to calculate SHA256 or generate some JSON, you sure as hell will be grateful your language has a library for it.
>Same applies to Python, btw.
That's a pretty uncommon opinion. What do you think are valid languages to create applications in?
>>
>>53644345
>>There is no point in having extra libraries for an primarily headless, embedded interpreter.
>Depends on what you're embedded it in and why. If you suddenly need to calculate SHA256 or generate some JSON, you sure as hell will be grateful your language has a library for it.
That's true, but when in doubt the bindings should be provided by the host application to prevent insecure APIs from leaking into untrusted scripts.
>>Same applies to Python, btw.
>That's a pretty uncommon opinion.
That's right, but I fear it is because most programmers are not aware of proper usage domains (!= problem domains).
>What do you think are valid languages to create applications in?
That's hard to put into a general rule, but here is some good rule for measurement:
The first/default/reference implementation of the programming language should be compiled to executable binaries (not simply wrapping interpreter APIs, how some "compilers do that"). Since we are talking about this specific implementation of a compiler, it ensures the language was designed to be compiled to a native executable and to be reasonable fast.
Good JIT-compilers (but only if this specific first implementation was that from the beginning) may be ok as well, but it's a controverse opinion, apparently.

Also, such a language should have reasonable Unicode support, a sane module system and a feature complete standard library. And by the last point I mean that dynamic arrays which support nested ones, linked lists etc. are in it.

There is probably more, the more you think about it.
>>
>>53644075
>>53644143

So something like Cython?
>>
weeb bonus
>>
A E S T H E T I C
>>
>>53644041
>But then again I'm not a developer
then wtf are you doing giving your opinion on programming languages?
>>
>>53641757
>>53641773
how very professional
>>
>>53643644
>This site was born out of a DrupalCon presentation to educate people of PHP's quirks. If you want to use this material to bash PHP you are in the wrong place.
Just saying...
>>
>>53648745
It still works very well for that, the stated intention not standing.
>>
>>53640944
doing some involving unicode with python and you will find the answer yourself.

hard mode: using python 3
>>
>>53642342
>I don't see why you'd want to use ANY of those for web dev. Except maybe node.
Elixir has 100% working code reload feature. Not that buggy implementation of ruby/python or other languages. Nodejs is just shit.
>>
>>53642342
Elixir is god-tier for web development with phoenix framework.
It's literally Ruby syntax with Lisp macros on top of Erlang.
>>
>>53645195
Cython isn't an embedded interpreter.
>>
>>53643895
>>53645195
No.
I looked a long time, but the closest thing Python comes up with is TinyPy and that is an outdated one man project.
>>
>>53649274
I have had no problems with Unicode in Python 3.5. What problems do you have in mind?
>>
>>53649771
manipulating chinese/japanese text files with different encoding.
>>
>>53650084
That is an encoding problem but not a Unicode problem.
>>
>>53650803
what the fuck are you talking about, it's still the same fucking problem about how python handling unicode and encoding, first they decided to using bytes to store strings, which is fine enough if you just treat it as a utf-8 strings (and do all the unicode stuff, like calculate string length, by yourself), then they went full retard and try to convert every fucking things to full unicode str type (at least they didn't attempt UTF16 like some fucking idiots at M$), so doing string manipulation with several encoding is a huge pain.

Any other sane languages would choose utf8 (aka just plain byte array with utf-8 aware functions) instead.
Thread replies: 49
Thread images: 3

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.