Tumgik
#programming languages
lavenderhorns · 1 year
Text
Every now and then I remember that Malbolge exists and I get to spend the better part of an hour cry-laughing at the world’s worst programming language
Tumblr media
already starting off strong, but it gets worse
Tumblr media
Wow! Sounds easy and intuitive to use! What’s the “crazy operation” you ask? We’ll get to that later. For now let’s see what a program in this language looks like :)
Tumblr media
Thanks! I hate it!
Tumblr media
it’s so difficult to work with that the first program was written by another brute force search program
Tumblr media
mmmmm delicious base-3 arithmetic, what could go wrong? (For reference, that means this program forgoes the usual “0/1″ values of binary code in favor of a much more fun “0/1/2″ set of values)
Tumblr media
ah.
Tumblr media
Here’s how the language actually figures out what to do. It’s got 8 “simple” commands that can be executed easily by *checks notes* running the code itself through the modulo operation and taking the result.
Tumblr media
As a bonus, on top of all that every single character in your code will now alter what every single other character does. So I hope you’re alright with cracking a cipher every time you add a new letter to your program!
Tumblr media
oh god oh fuck.
Tumblr media
behold, Malbolge’s primary arithmetic operation and what you’ll be using for most of your math while programming with it :)
This looks specifically designed to be the least logical math operation you could make, and knowing what the rest of Malbolge is I’d wager that’s precisely what happened. I never want to ever use this and it’s my favorite thing I’ve ever seen.
https://en.wikipedia.org/wiki/Malbolge
Anyways here’s the wiki page if you wanna read through it more deeply, I’m gonna sit here holding in my laughter staring at the hello world program again.
12K notes · View notes
agent-z-coding · 25 days
Text
I HAVE FINALLY SUCCEEDED
Tumblr media Tumblr media
IT WORKS!!! IT WORKS!!!!!
[4, 5, 4.3] -> add BECOMES 13.3!!!!!!!!!!
YOU PEOPLE I HAVE DONE IT
source code will be coming soon (as soon as i get more helper functions working.
For now, PLEASE contribute if you can. Even as little as suggesting some helper functions could help me a ton.
Contribute below:
Open a PR, An issue, Anything, Just mention what the language lacks and you don't even need to implement it yourself, I'll add it to the To-Do list and get working on it ASAP.
Join the discord server, I will be posting updates and asking for suggestions and providing beta builds: https://discord.gg/JxnKn9jd
68 notes · View notes
Text
Tumblr media
Post #91: Pinterest, @usamaawan5752, Python Road Map, 2023.
119 notes · View notes
smak-annihilation · 6 months
Text
linguist parents of a programmer who don't approve of their child's decision to not persue the family craft:
"so anyways, when are you gonna learn a REEAL language?"
"There are always open spots in German"
117 notes · View notes
just-a-girl-0001 · 2 months
Text
Magic system that's based on programming:
Each spell needs a corresponding script to be used, you can't use magic without a script. And you can't use scripts without shells.
Shells are devices that interpret and utilize scripts written by the magic user. Originally, common folk had to write scripts via long and drawn out scrolls of black and white inkings. While script writers could use these scripts without shells, they took far longer to write. Furthermore, they had to be imbued into casting glass. Which would shatter upon use. This caused a lot of common folk to think of magic as a useless gimmick.
However, after the creation of shells and the practice of stuffing said shells with pre-written dictionary pages. Common folk could finally start understanding/practicing magic. Often dictionary pages were taken from libraries of well known common words, however due to the nature of shells some shell languages are more useful for certain tasks than others. Because of this, magic use overall ramped up. Even starting script schools for those who wish to alter and control aspects of the world.
Each script requires a proper syntax which corresponds to the shell's internal dictionary. While you can add pages from other dictionaries, it's seen as more cumbersome. So most script writers bring multiple shells with them. However, if you are more familiar with one type of shells syntax, there is no shame in modifying the shell.
Basilisk is a novice spell script language. Which focuses on controlling, observation, and automation. Most script writers start with this language, mostly due to the fact the school's mascot is so cute.(being two snakes with sea shells on their tails) even though it is seen as the easiest, a lot of new script writers fail to utilize it to its fullest potential. Unfortunately, a lot of experienced writers of other script languages, tend to dismiss the work of basilisk magic. The speed of the shells cast is slower, but they still work just fine for the average user.
Slash is less commonly used in comparison due to their shells being used in a majority of magical devices found within high magic environments. Often common folk see it as daunting. Going as far as to say it's the work of demons. But in reality, it is based on the old gods religion. Some who use it say they feel as if they were "Bourne again" but there is a majority of slash users that do not know of the old gods. Simply using slash as the shell that it is. Because of Slash's integration into a majority of magical devices. Users of flash can often manipulate these devices to do what they want. By inserting Slash scripts into a device's shell. The reason why most magical devices have shells built into them. Is because they often need to be modified and upgraded. While the pages that are utilized in the Shell are changed. Remnants of the original pages tend to linger. Allowing some to break open the shell, and assess the changes that occurred to it over the course of its life.
Finally sea shell is ranked amongst the hardest. These script writers often attempt to control reality and the perception of it. Those who know it tend to enjoy showing off their skills to the common folk. By making interactive books and other media like it.
But if one is truly adept, they can completely reconfigure incoming spells to be more in their favor, via Re-write injections. These scripts are shot into the shells of opposing script writers. Which then makes the script act differently from what was originally written. Sea shell users can do this because of the research they put into learning how common scripts are written. (You'd be surprised how much is simply copied from other script writers these days.) Because of this, it allows them to prey on the opposing script writer's vulnerabilities. Even so, there are Sea shell users that copy their scripts from other Sea shell users. This causes a lot of fighting within their community. Mostly from those who are more narcissistic.
The origin of the name Sea shell comes from the fact that the first shell was a seashell stuffed with scavenged papers. These papers were thought to be from an ancient underwater library. But the logistics of this don't seem to make sense. The first user of the seashell shell was recorded as an unnamed scriptwriter of old. Yet no one knows what they looked like, some suspect they were dark haired, and small in body. However, some like to believe they were a seafolk of some kind. However most of these recountings seem to be fiction rather than fact. One thing that we do have on the script writer's existence. Is the original shell that was used. Some believe that if one was to truly master the Sea shell language. The original seashell would speak to them, in the voice of the original script writer. However no one has heard their voice yet.
(I really had fun with this I hope anyone who sees this enjoys it <3)
24 notes · View notes
zackbuildit · 4 months
Text
Bad things about inventing a new low level programming language:
You suffer as you discover for the first time you really, truly, will never understand stack coding
You find out about flags and flag logic by involuntarily being forced to reinvent it in a nigh vain attempt to escape from Yet Another Data Structure
You realize that you still have to make an interpreter and so you cry
Good things about inventing a new programming language:
This list is incomplete, you can help by expanding it.
27 notes · View notes
momentai0 · 7 months
Text
If you think about it coding is just programing language fanfiction
43 notes · View notes
pontaoski · 7 months
Text
computer nerds when the boring office service requires an internet connection to function: 🤮
computer nerds when the programming language requires an internet connection to function: 🤩
25 notes · View notes
devhubby · 8 months
Text
How to Call MySQL Stored Procedures from Node.js?
Tumblr media
Read more at: https://elvanco.com/blog/how-to-call-mysql-stored-procedures-from-node-js
20 notes · View notes
agent-z-coding · 1 month
Text
Writing a programming language in C. How is this syntax:
Tumblr media
Join the discord server, I will be posting updates and asking for suggestions and providing beta builds: https://discord.gg/JxnKn9jd
42 notes · View notes
The Lambda Calculus and Typed De Bruijn Indices
I thought I'd write up another little post about something in CS that I think is cool. This one is about variable binding and types, with some Haskell code (with GADTs and pseudo-dependent types) later on.
In other words, this is going to be a bunch of math and logic and then some Haskell nonsense. Be warned.
So, to start off: the lambda calculus. Extremely simple language that just has functions (that you write with a λ), and function application. We can write the identity function as (λ x. x), which we can read as "a function that takes x as input and returns that same x." A function that takes two arguments and returns the first can be written as (λx. λy. x), and a similar function that returns the second argument would be written as (λx. λy. y). Function application works straightforwardly, so (λ x. x) 42 evaluates to 42, and (λx. λy. y) 69 420 evaluates to 420.
To write out our functions like this we use variables, typically one letter. This is convenient---there's a reason basically every popular programming language uses variable names---but it has some downsides. To get to that, let's talk about alpha equivalence.
If we have two functions, (λ x. x) and (λ y. y), what can we say about them? Well, they both just return whatever their argument is. They're actually both the same function; they're both the identity function.
Of course, in general, determining if two arbitrary functions are equal is a little complicated. One definition of equality for functions is called function extensionality, which says that two functions are equal if they always produce the same output from every input (if for all x, f(x) = g(x), then f = g), and that can be tricky to deal with. But our two functions, (λ x. x) and (λ y. y), are literally written the same, except for a switched-out variable name!
That notion of two functions being written exactly the same except for different chosen variable names is called alpha equivalence. (λ x. x) and (λ y. y) are alpha equivalent. This captures the intuitive idea that changing variable names won't change what the program does, as long as they don't clash or overlap.
The Dutch mathematician Nicolaas Govert de Bruijn came up with an alternate notation for these functions that made this explicit. Instead of using names, you use numbers. So (λ x. x) becomes (λ 0), for example, and (λx. λy. x) becomes (λ λ 1). You can read the number as something like "starting from here and working backwards, this is how many lambdas to jump over," (beginning at 0 of course). So the 1 in (λ λ 1) is referring to the binding from the first lambda, whereas in (λ λ 0) the 0 is referring to the binding from the second lambda.
This illustration from Wikipedia represents how to write the lambda calculus program λz. (λy. y (λx. x)) (λx. z x) using De Bruijn indices:
Tumblr media
One immediately neat thing about this is that it makes alpha equivalence trivial. Both (λ x. x) and (λ y. y) are now just written (λ 0).
Another benefit of this approach is that it is particularly convenient when doing formal reasoning about programming languages. To get into that, first I'll explain types and the lambda calculus.
Tumblr media
This is a common presentation of the typing rules for a language called the simply-typed lambda calculus. You can read the lines as "if what is above the line is true, then what is below the line is true," and the things that look like Γ ⊢ x : t as "assuming type environment Γ we can prove x has type t." Going through each rule:
If from assumed type environment Γ we know x has type σ, then we can prove x has type σ.
If some constant c has type T, then we can prove c has type T.
If we assume x has type σ, and from that conclude e has type τ, then we can prove (λx:σ. e) has type σ → τ (where the x:σ bit is a type annotation).
If we know e1 is a function of type σ → τ, and we know e2 is of type σ, then if we apply (e1 e2) then the result we get will have type τ.
Basically, Γ contains a list of (variable:type) pairs, because it records the assumptions of what the type of each variable is assumed to be.
So, let's throw out all those variables! If we use De Bruijn indices, then Γ is just a list of types. This makes it very convenient to work with in the setting of something like a proof assistant, or a programming language with dependent types.
Now I'll show how we can use all of this to write a so-called "type-safe interpreter" in Haskell. This is actually a somewhat common example program to write in a dependently typed language, because it's relatively simple (ha!) and it shows off some of the neat things you can do with types.
This post is already getting long so I'll jump right to the code. This is a data type for encoding the STLC:
Tumblr media
This is a GADT, or generalised algebraic data type. It is parameterised by two types: the type environment, and the result type. So 'Expr as a' can be read as "a program that assumes type environment as and will produce a value of type a." If you look closely, you'll see that the constructors of this data type declaration line up with the numbered rules above.
This is a definition of a very simple AST, or abstract syntax tree, for a language. Can we write an interpreter for our language that uses this data type? Yes!
Tumblr media
Before we can actually run it we need to get the rest of the definitions out of the way. First, natural numbers, typical peano numbers:
Tumblr media
Then the Index typeclass, for indexing into type environments:
Tumblr media
With all that done, we can interpret some programs!
Tumblr media
That's it! We call this a "type-safe interpreter" because we have a guarantee that the program is well typed, and we have a guarantee that the interpreter is respecting those types. Isn't that cool?
132 notes · View notes
idk about you folks, but glup shitto guitar shredding the beatles has such webbed site energy
8 notes · View notes
mr-abhishek-kumar · 6 months
Text
Amazon app store doesn't let's you delete apps 😡
So I got to know that Amazon app store doesn't let you delete apps that you have published !! And now I can't even update my old web apps there !!! I have 7 apps in Amazon app store and I want to remove them because of poor developer experience of Amazon, but get this?!! They will not let you even remove apps. To get it published you have to dance to their drums!! To get it removed you have to dance to their drums!!! I HATE AMAZON !!!
Tumblr media
13 notes · View notes
smak-annihilation · 5 months
Text
Tumblr media
10 notes · View notes
Text
Programming Languages
Tumblr media
Post #30: The variety of programming languages, 2022.
160 notes · View notes