slash-lang / slash Goto Github PK
View Code? Open in Web Editor NEWA new language for the web
Home Page: http://slash-lang.org
License: MIT License
A new language for the web
Home Page: http://slash-lang.org
License: MIT License
It isn't clear from the site.
What other I/O APIs are there?
making a note, i will check on this later if noone else gets to it:
def foo {
"zomg split already".split();
}
results with: ArgumentError: Too few arguments. Expected 1, received 0.
to work around this i can do the following:
def foo {
"zomg ok this works".split(" ");
}
Possibly with define_method for defining methods that contain variables etc.
You could easily make Slash installable via Homebrew using a script like this:
require 'formula'
class Slash < Formula
homepage 'http://slash-lang.org'
url 'DOWNLOAD_LINK'
mirror 'DOWNLOAD MIRROR'
sha1 'SHA1 HASH' # or md5
DEPS = ['gmp', 'pcre', 'libgcrypt', 'yajl', 'discount']
DEPS.each do |dep|
depend_on dep
end
def install
system "./configure --prefix=#{prefix}"
system 'make && make install'
end
end
I got a curious \x00 like below.
>> "Å".lower
=> "å\x00"
>> "Å".lower.length
=> 1
>> ("Å".lower + "a").length
=> 3
Is this known?
I'm trying to install Slash on a Linux Mint system.
$ ./configure --with-lib-dir=/usr/lib/i386-linux-gnu/
CC environment variable not set, falling back to 'cc'...
Checking for cc... cc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
Checking for flex... flex 2.5.35
Checking for libgmp... ok
Checking for libiconv... ok
Checking for libpcre... ok
Checking for a thread-safe time.h... ok
Checking for -march=native... ok
Checking for -flto... ok
Checking for __builtin_expect... ok
Checking for unistd.h... ok
Checking for -Wno-gnu... ok
Checking for computed goto... ok
Configuring ext/base64
Configuring ext/curl
Checking for libcurl... failed
Could not find libcurl (used -lcurl)
Please make sure it is available before building Slash
The directory /usr/lib/i386-linux-gnu/
contains:
libcurl-gnutls.so.3
libcurl-gnutls.so.4
libcurl-gnutls.so.4.2.0
libcurl-nss.so.3
libcurl-nss.so.4
libcurl-nss.so.4.2.0
libcurl.so.3
libcurl.so.4
libcurl.so.4.2.0
I assume I'm doing something wrong. How can I get ./configure
to detect libcurl?
I tried to build slash on my laptop which did not have ruby.
The configure did not warn me about it, and make obviously thrown an error when executing gen scripts.
I think it may be good to check ruby on configure to warn the user.
As far as I see 'make' builds only static library.
Some distros (e.g. Linux Arch) strongly prefer to deal with shared libraries. shared libraries are handly in many cases.
It would be really useful if slash provided shared libraries as well.
Do you have any plans for this?
It would let you run it under Nginx and a number of other web servers quite easily.
Some docs incase you wanted/needed to look for them
I'm really new on this, but the syntax for lambdas it feels weird:
print(foo(\x { x * x }), "\n"); # => 81
print(foo(λ x . x ** x), "\n"); # => 38742048
In other languages:
print(foo(x -> { x * x }), "\n"); # => 81
print(foo({ x -> x * x }), "\n"); # => 81
print(foo({ |x| x * x }), "\n"); # => 81
print(foo(x -> { x ** x }), "\n"); # => 38742048
print(foo({ x -> x ** x }), "\n"); # => 38742048
print(foo({ |x| x ** x }), "\n"); # => 38742048
Which feels less weird?
Could we see Nginx support for Slash's SAPI some time in the future? There is a nice guide on creating Nginx modules here.
Given: slash-cli is compiled and you have the slash source code
When: You're in the slash/test
directory
And: You run slash-cli test.sl core/array.sl
Then: You see this error:
NameError: Undefined constant 'Test' in Object
at <main> in /Users/acook/Pork/slash/test/test.sl, line 3
at <main> in test.sl, line 3
When: You're in the slash
root source directory
And: You run slash-cli test/test.sl test/core/array.sl
Then: Tests are run successfully with this output:
...................
Tests finished. 19 passes, 0 failures, 182 assertions.
That seems weird to me. I can't figure out why just from looking at the source code either.
In the following situation, an error will be thrown because slash thinks I want to call the []
method of the Method
(bar
) that I'm defining, while in reality I want to do something completely different.
def bar {
...;
}
[1, 2, 3].each(\n { n * n });
Produces:
NoMethodError: Undefined method '[]' on #<Method:0xdeadbeef>
...
plz.
There's currently no way to check if a file exists. The only way to do this is to attempt to read the file and catch the NotFound error.
File.exists?(path)
#=> True | False
I could not find any file written in Slash itself.
It's currently impossible to, for example, list a directory's contents. A component such as ruby's Dir
is a needed addition.
I'd like to contribute to this project. Is there a repo containing the documentation anywhere? I would like to dig into this language, ask a bunch of stupid questions, and hopefully add to the documentation what I find. I am an experienced Rubyist (2005 - present), and a recovering PHP user (1999 - 2010), so I hope I can bring something to the party. I can sort of limp through C, so maybe there wouldn't need to be too many stupid questions...
It would be nice to have the ability to declare classes without explicit nesting.
Currently:
class Foo {
class Bar {
class UhOh { }
}
}
This can quickly become a bit cumbersome.
Suggestion:
class Foo::Bar::UhOh {
def init { 'yay }
}
The following two (magic) constants are missing, and would be useful:
__FILE__
: absolute path to the current file
__DIR__
: absolute path to the directory of the current file
Possibly a global SAPI constant.
Hello
I would like to use this. However, I would need a tutorial, on how to set up a complete environment in my laptop. I am running cherokee to serve to outside world. How do I use slash with it? Do I make a slash page to dump its output to a socket? This can be achined by calling slash-cgi - like here : https://github.com/slash-lang/slash/tree/master/sapi/cgi , and then read it out by cherokee? Or is there a parser module that goes through the page, performs parsing and so on? How are the get / post methods handled?
I need some simple directions to get started with this.
Thank you.
PS : Current setup :
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.