moved from shitjs/meta/issues/2
Initial thoughts
informal description
- written in JavaScript
- no statements, only expressions
- no
var (variables are always declared in a global scope by default) - no
return – ShitScript returns the last evaluated expression - no floating point numbers (only integers)
- no unary operators (?)
- no classes, no
array's, no object's (except for console and window)
shitty ideas
- allow using
-, ?, ! in function names (no-camel-case) - super weird type coercions (or just some non-obvious implicit coercions result in string
'shit') ; -> )))=== -> ====, !== -> !===(...) -> [...]function -> shit / fucktry -> why-the-fuck-notcatch -> fucked-upfinally -> dont-fucking-care- say
please to enable lexical scoping - you can't use a couple of numbers (e.g.
4 and 2) for no reason x / 0 = Math.random()if -> o-rly?then -> ya-rlyelse -> no-wayo-rly?-ya-rly-no-way for one-liners (without brackets). -> -> (works only for console and window)
an example program:
fuckwat[]{calculate!!![2,0])))}shitcalculate!!![y,x]please{z=5)))why-the-fuck-not{o-rly? z%2====0{y/x)))}no-way{x/y)))}}fucked-up[e]{console.lol[e])))}dont-fucking-care{0)))}}P.S.: Not sure about using words fuck and shit everywhere (may be considered offensive)
moved from shitjs/meta/issues/2
Initial thoughts
informal description
var(variables are always declared in a global scope by default)return– ShitScript returns the last evaluated expressionarray's, noobject's (except forconsoleandwindow)shitty ideas
-,?,!in function names (no-camel-case)'shit');->)))===->====,!==->!===(...)->[...]function->shit/fucktry->why-the-fuck-notcatch->fucked-upfinally->dont-fucking-carepleaseto enable lexical scoping4and2) for no reasonx / 0=Math.random()if->o-rly?then->ya-rlyelse->no-wayo-rly?-ya-rly-no-wayfor one-liners (without brackets).->->(works only forconsoleandwindow)an example program:
P.S.: Not sure about using words
fuckandshiteverywhere (may be considered offensive)