5 ms·
Hi, I'm the author of Slash. I wasn't expecting Slash to show up here so soon - the website's pretty out of date and the language itself still needs a bit more
by charliesome 13y ago
Hi, I'm the author of Slash. I wasn't expecting Slash to show up here so soon - the website's pretty out of date and the language itself still needs a bit more polish before it's ready for use.
Slash is something I'm building out of personal need. I love Ruby, but there isn't much going on in the 'small web scripts' area. It's either frameworks like Rails or Sinatra that require app servers constantly running, or tools like Jekyll that can only do static websites. Slash is somewhere in between. It's not supposed to be a 'PHP successor' as much as it's supposed to be something that Python or Ruby fans can turn to when they just need to chuck a small script up on the web.
- rst 13y agoIf deployment is the key issue, you don't necessarily need to change the language. What you need is glue code that hooks Ruby (or Python, or whatever) into the web server at the same level as PHP hooks in, the way the ancient mod_perl does for Perl. (Which is also probably a bit less implementation work than doing a whole new language --- and also gives users the benefit of a much larger set of libraries right off the bat.) EDIT: as pointed out below, mod_python for Apache already goes pretty far in this direction.
- groovy2shoes 13y agoSure, but doing a new language is fun, and can be a learning experience.
- Skoofoo 13y agoI second this. The language appears to be a Ruby with a slightly modified syntax, and most programmers won't be excited about keeping track of the differences. Use Ruby for this and everyone will benefit.
- charliesome 13y ago> What you need is glue code that hooks Ruby (or Python, or whatever) into the web server at the same level as PHP hooks in, the way the ancient mod_perl does for Perl. The problem with this approach is that MRI Ruby has tonnes of global state, so unless you restart the interpreter for each request, you're going to end up with state leaking between requests. Slash is designed so that many VMs can be quickly created in the same process without any shared global state. This way each request runs in its own isolated context and can't affect any other requests.
- mgkimsal 13y ago>The problem with this approach is that MRI Ruby has tonnes of global state, so unless you restart the interpreter for each request, you're going to end up with state leaking between requests. So what? That's how PHP works, and it's still pretty fast for most things. Would a mod_ruby be that much slower? Should still be faster than a CGI-style invocation.
- sitharus 13y agoPHP only works like that because Apache's default process model is process-per-request. Anything event based requires moving PHP in to multiple fcgi worker processes, and then you get limited by that. A fast, non-shared interpreter could work very well in a threaded server, or a threaded backend to an event-based server.
- ivanhoe 13y agoJust for the record there are a huge differences between how mod_perl and mod_php work. One of the main reasons that PHP got so popular in the first place was that mod_perl was really boring and complicated to work with because it was keeping all the scripts and modules and globals loaded and shared between requests.
- nnq 13y agoIf you did a python/ruby/node-javascript that would capture the best features of PHP, instead of inventing a whole new language, I'd actually be tempted to use it. The features (or what others would call anti-features, but one man's "bug" can be another's "features" so lets ignore the long talk) would simply be: 1. Ultra-Ease of deloyment - I want to be able to just: - load a module for my webserver of choice (Apache, NGINX etc.) - drop code in a folder via ftp and have it "just work" - have a shared nothing app model with no long running processes, PHP style, because this way I can ignore 99% of security and performance problems, both as a provider of dirt-cheap shared hosting and as the developer of a web application that doesn't need to scale that much and isn't that much of a target for hackers either (so I can have the following mindset: "I don't need to care about scalability/performance or security, because by the time I'll need to care about these I'll be already making enough profit from it to be able to hire some very smart guys to rewrite everything from scratch the right way or I will have already sold the company and be enjoying my $ while others care about this") 2. Ultra-Eease of app/site setup: - I want to just drop files in a folder and have it work, just like that, just like magic 3. "Don't make me think" style of development: - I want the same language in my controllers, in my db code AND in my templates - plus points if it's in the browser too - have all the component I and other might need in "one pack", "batteries included" style 4. Almost non-existent learning curve: - someone should be able to go from A - "poetry major with no knowledge of what computers are" to B - "expericenced full-stack developer" withouth feeling any learning curve: yeah, it will take time to get from A to B, the first 10% of the road should be made as easy as possible ...and to "kill" PHP you'd still need to add a killer extra feature. I can imagine something like an object persistence feature (Maglev/Gemstone style) baked into the language/library/framework that would allow you to simply persist objects without even thinking about a database (it could be implemented as a very smart ORM underneath, but it should be as opaque/black-boxed as possible and 99.99% of users shouldn't need to know how it works) - this imho would be the kind of thing really enjoyed by PHP developers.
- porker 13y agoIsn't this asking for all the features that lead HN-readers to despise PHP?
- tomphoolery 13y agoI love the name "yada-yada operator" :D
- draegtun 13y agoThat comes from Perl (which was added at 5.12 however it originated from the Perl6 spec). See http://search.cpan.org/~jesse/perl-5.12.0/pod/perlop.pod#Yada_Yada_Operator http://search.cpan.org/~jesse/perl-5.12.0/pod/perlop.pod#Yad... And search for "yada" in the following links: - http://perldoc.perl.org/perlsyn.html http://perldoc.perl.org/perlsyn.html - http://perl6.org/archive/doc/design/apo/A12.html http://perl6.org/archive/doc/design/apo/A12.html
- eranation 13y agoAwesome job. I'm impressed how many interesting and complex open source projects you created / contributed to. And you are only 19! What age did you start coding? And how did you learn? By yourself? Early CS degree? I'm a bit envy. Github hired you for a good reason probably. Slash looks really interesting, will keep a watch on it. I have some constructive remarks but it was all said already in other comments. Are you using it somewhere in production? What is the runtime? How is concurrency handled? Do you have performance benchmarks? Great stuff overall. Keep it up.
- muhuk 13y agoI wish this was top. There's merit in creating a new language, even if it's just for learning. I'm not saying we shouldn't constructively criticize the language itself. I'm just glad the merit is recognized as well.
- wirrbel 13y agoWhat is the actual benefit of slash, compared to python or ruby with a templating engine? Something like http://slim-lang.com/ http://slim-lang.com/ which is ruby templateing for example. The PHP approach seems kind of messy in jumbling together (1) a programming language and (2) plain HTML notation Also: Are you just feeding through the HTML parts or are they parsed/validated/inspectable? Can one work with DOM nodes? (This is what I like about https://github.com/weavejester/hiccup/wiki/Syntax https://github.com/weavejester/hiccup/wiki/Syntax )