Is there a decent scripting language with C-like syntax and no annoying quirks? Switching between C and scripting becomes a pain in the ass with all of the popular language's weird shit.
Javascript: has "prototypes" plus some weird ==/=== shit
Lua: has no switch statement, ~= and uses if/then for blocks instead of {/}, no ++/--/+=/-=
Python: whitespace instead of {/}, ew, also no ++/--
Ruby: still don't understand this one
Go: :=
Why are all the popular scripting languages absolute shit, syntax wise? Are there any better alternatives without shit syntax that aren't really known?
Sometimes just I want to make something quickly with C's nice syntax, but without all it's bullshit (when I don't need performance).
Realistically, you're going to pick lua or javascript because both of them embed really well into large monolithic applications like games or web browsers. Javascript is mostly C-like so long as you remember that every variable likes to become a string.
Oliver Wright
>without shit syntax
James Hughes
I'm not really looking for anything embedded, when I said scripting language I guess what I really meant is a relatively simple language that you can quickly write low-to-medium complexity programs in (that don't require performance) without worrying about low level stuff and strict rules, setting up an enviroment and cmake, all that time consuming stuff.
Jayden Cook
I'll probably get a shit ton of flak for this and I know OP doesn't like python, but I've grown to like python for automation. This is coming from a embedded OS person who lives C and thinks its pretty much the pinnacle of programming languages. Yeah the white space shit is weird to get used to but its not as bad as you'd think.
That said, I like python because they don't use use/learn all sorts of cute signs, symbols, sigils, jiggers and what have yous. It also tends to be more readable in the long run which is pretty great compared to the god fucking awful BASH and perl scripts I've had to with python.
I'd give python another shot.
Christian Sanders
just write a shell script if you don't want to write a real program, the syntax isn't that bad, but you do have to get used to the quirks of POSIX shell
Ethan Bennett
shell scripting is so bad it's a reason to learn something like Python or Go just to avoid the disgusting syntax. Every time I'm working on a shell script and I start reading up on how to do something, it makes me want to puke.
Wyatt Lee
Could you explain a time when this actually happened? I bet it wasn't even that bad.
Carson Hill
Sounds like you want a strongly-typed language. I recommend Java.
Benjamin Watson
D, maybe. rdmd is handy
Dylan Lee
>scripting language >C-like syntax why would anybody want such a thing
Sebastian Thomas
Consider Ruby?
no {} but the end keyword makes it a lot better than python's take on it. Overall, iv been able to solve problems much quicker in ruby than other similar languages iv tried.
Ian Young
um.... c? take the jsPill. or ruby. or perl. or sh.
Lucas Jones
also it's quite employable in the current year
Julian Bell
>Go: := This is just shorthand and isn't required. i := 0 var i = 0 both do the same thing
Angel Robinson
I see you are more concerned about aesthetics than actually getting something done. There is no cure for stupidity.
Colton Morgan
git gud fagit
Chase Lopez
You want a language like C, but with no annoying quirks? If it didn't have annoying quirks, it wouldn't be like C.
Brody Price
Try a C interpreter, so you can reuse the code in C later on. The old CERN C/C++ interpreter: www.hanno.jp/gotom/Cint.html The new CERN C/C++ interpreter: root.cern.ch/cling
William Hill
Just write an interpreter for C
Chase Clark
Javascript has had classes since forever. Just don't fucking use ==.
Parker Carter
The := in go is just shorthand, you can assign variables just like in C if you really want to
Alexander Reyes
This thread is surprisingly relevant. I, too, seek what you seek OP. Years ago I actually did this with the PHP CLI interpreter.
Ayden Garcia
>Go: :=
what's the problem exactly?
David Miller
Look csh and tcsh.
William Thomas
Perl u fucking retard
Grayson Miller
What's wrong with python or ruby? You easily get used to python's whitespace delimiting and you barely need to use i++ because of range(). If you're used to curly braces, ruby might feel a bit more natural though since you're delimiting with do/end.
Either way, they're both great languages for quick scripting because their syntax doesn't create retarded word salad. It just takes some time to get used to.
However, if you enjoy torturing yourself give bash or perl a try.
Alexander Fisher
Why not write a preprocessor for your least disliked scripting language to make it work the way you want?
Landon Peterson
Not C-like but for scripting I'm learning GNU Guile, which is a scheme. Racket is very good also.
Dominic Ramirez
>range
>he doesn't implement his code recursively
you disgust me
Eli Perez
> Can't understand weak type comparison > Can't handle slightly different operators > Can't handle whitespace > Can't learn a language designed to be easy to learn > Can't handle different operators
> “Why are all the popular scripting languages absolute shit?” The answer comes from within.
To actually answer your question, look at Perl.
Levi Cook
literally c#,java.
Ethan Sullivan
Those aren't scripting langwayjes boi
Joshua Scott
but they are what op wants.a nice c-like syntax with an easy to learn/use and safe language.
Sean Barret (of stb_libraries and Looking Glass studios fame) uses C as his scripting language. He tried making his own C-like scripting language but realized what he mainly needed was good libraries (that's the gist of the talk below). youtu.be/eAhWIO1Ra6M
Luis Murphy
Lily
Leo Cook
could you not just use c with an interpreter??
Isaac Young
/thread
David Baker
>Always use undefined, never use null >Always use === over ==, except when comparing against undefined (because x == undefined is the exact same as x == null) >Don’t fuck around with the prototypes >Always use let and const over var There, I just fixed JavaScript for you.
Kevin Ortiz
>Lua: has no switch statement, ~= and uses if/then for blocks instead of {/}, no ++/--/+=/-= >Python: whitespace instead of {/}, ew, also no ++/--
Python has no switch statement either, nor real constant variables, but you didn't point those out either, it's obvious you don't know jack about the languages you are talking about aside from stuff you read from Sup Forums turds
Chase White
Lua is cute.
Lincoln Collins
tcl
Juan Ramirez
Well if you're on Windows, Powershell is kind of magical.
Evan Bennett
PowerShell's on Linux too.
Landon Reyes
>Why are all the popular scripting languages absolute shit, syntax wise? Because C did it wrong
>Go: := Really, nigger?
Charles Nguyen
Sure but I've never tried it there - PS isn't magical because of the shell scripting capabilities (though those are great too) but because of the ability to import .net modules which I don't know if it has on Linux?
Samuel Walker
iirc Microsoft opened .Net as well so Linux should have it
Juan Davis
>Because C did it wrong /thread
Evan Walker
...sounds fake but maybe isn't.
I'll check.
If it's true though, Mono developers on suicide watch.
>PowerShell on Linux is based on CoreCLR while mono is a clone of the CLR / full framework. The assembly you are using is a full framework one and cannot load in CoreCLR since it is based on mscorlib and not System.Runtime. >In a year there will be a workaround (maybe) with the upcoming .NET Standard 2.0.