4 languages that can kill themselves
4 files, each with a different language. Each file will call the next file, and then commit die. Like this:
Basically how this works is each file calls 2 shell commands, one to run the next file, and one to commit toaster bath. The bash command to commit skydiving without a parachute is
I also added brief comments on how the shell commands work in each language so you might learn something.
I'm just bored.
@MohammedBalsara Okay, try to make a lexer first. A lexer takes in a string input, and turns that into a list of "tokens". A token is a class which has a type, and the actual token.
(you do python right?)
A token might look like this:
Right now, you can start small and only focus on arithmetic operations. You want your code to take in input like:
And print this:
I can't do it for me it says
clang++-7 -pthread -std=c++17 -o main
clang: error: no input files
conpiler exit status 1
see I can't do it
At first I was so confused, but I understand now! Very cool, lol. It deleted all the files and I’m left with main.exe, not sure if that’s was supposed to be deleted.
cool but errmmm...
mind:spit it out stop wasting time
me: hows squid going to take the comment
mind: tell me what the comment is
me: whts the point of this
mind: you can clearly see that it's usefull
mind: he saw our conversation.
mind: squid said they where board when squid posted it
ME:HEY SQUID THIS WAS TOTALLY USEFUL DELETING A BUNCH OF FILES
mind: IT'S DESTROYING THE FILE!!! THE MAIN FILE!!
me: ohh!! thats why it's useful. :)
mind:so you can start a project without the main file
There's basically two types of languages: "// for comment" languages and "# for comment" languages
map toUpper "squid" is the canonical way to do it. The goal of idiomatic Haskell code is to remove as many named variables as possible — defining
uppercase_letter letter is verbose, if you really wanted to do it that way you'd do
map (\letter -> toUpper letter) "squid", but
(\letter -> toUpper letter) is the same as just
toUpper. Yeah, coming from low-level languages Haskell probably seems weird, however it's way cleaner and if you use it enough it's the low-level languages that start to seem weird :D
@DynamicSquid smh true believers use
(\var -> (\var -> [code that uses "var"] ) 3) 5
You must feel the cleanliness of the lambda calculus course through you before you prepare to do the trivial mortal task of code production, or else you will forever live in the land of anguish and never reach functional nirvana. Do that which is functional, let the bindings of imperative programming break loose, and you shall then reach inner peace with the computers.
...Or just use a bunch of random
do blocks, whatevs honestly