KindaABigDyl

joined 1 year ago
[–] KindaABigDyl 4 points 1 year ago (3 children)

Python - 94 chars

I tried using some alternatives, but they all ended up more verbose than:

def a(n):
 for i in range(0,n):
  print(' '*(n-i)+'* '*(i+1)+' '*(n-i-1))
 print(' '*(n-1)+'| |')

The list tools in python are great, but they all use keywords, so doing anything that doesn't directly do for and print is likely too much. You could make a list of strings for instance, and print it all out at once to save a 'print' but you'd end up using a for in list comprehension or a join or something, so you can't really save any characters afaict.

I'm sure someone will find a way to beat it tho!

[–] KindaABigDyl 1 points 1 year ago (2 children)

Here's a couple example programs.

hello_world.mjut

# Print a simple hello world message
let msg :: &Char = "Hello, world!\n"
mutate:
- stdout write msg

truth_machine.mjut

# Truth machine - if you input a 1, it prints 1 forever
# But a 0, it prints 0 & quits
let inp :: Char = 0
mutate:
- stdin alloc_read_line # Read data into stdin :: &Char
- inp := stdin:0
- inp -= '0'
- if inp - goto quit;
- forever:
    + stdout write "1"
    + goto forever
- quit:
    + stdout write "0"

I think I have it fleshed out enough to get a basic version working. I'll write up a lexer and parser tomorrow (it's after midnight, so actually today lol) probably

[–] KindaABigDyl 2 points 1 year ago* (last edited 1 year ago) (3 children)

Update: I wrote up a quick manual for the language explaining concepts in more depth and reworking the syntax

[–] KindaABigDyl 2 points 1 year ago

On second thought, this could be a bad idea. It's my company's VPN. I'd have to keep track of my employer's certificate when backing up my config along with my username for the login and other stuff that could pose a security risk.

Still should be possible, but in this case, probably a bad idea lol

[–] KindaABigDyl 7 points 1 year ago (1 children)

I got a book on Haskell at half price books.

[–] KindaABigDyl 1 points 1 year ago

That looks pretty sick, thanks!

[–] KindaABigDyl 2 points 1 year ago

I used to do it on my tablet for a while trying to mess with building on Linux ARM, but it was never more than just playing around.

[–] KindaABigDyl 3 points 1 year ago

There are add-ons?

[–] KindaABigDyl 1 points 1 year ago* (last edited 1 year ago)

BotW is a cool game, and I had fun playing it.

That fun didn't last very long though. I got bored pretty quickly. I'm not sure I even have 50hrs in it to this day. I did some shrines and got the divine beasts, but I never felt compelled to 100% or fight Ganon or do any side quests.

It had a cool premise, but there just wasn't enough stuff to keep me interested, and tbh I think that's true across the board, bc from what I've seen, most of the people who get tons and tons of fun out of it are making their own fun doing stuff like speed running and finding glitches, not just generally playing the game. Those kind of things don't interest me. If I wanted just a sandbox, I'd play Minecraft or Gary's Mod or something.

On the other hand, I'm already at 100hrs now in TotK. I got all the depths filled out, completed more shrines than I ever did in BotW (and found more than exist in BotW), completed a ton of the side quests (especially the "Side Adventures" ones that I really enjoyed), got all of the old games' armors and upgraded them fully (except TP; dear Lord it is too much Topaz!!!), explored lots of caves and wells, etc, etc. I'm doing things in the game, and I'll keep doing things through this game. Everything is so much more engaging. TotK takes the intricate sandbox world and actually makes it worth using.

Tl; Dr: I dropped BotW whereas I'm actually playing TotK. BotW was a really cool experience, but I'm firmly in the camp of "TotK makes BotW feel like a tech demo." Do I still have love for BotW? In some ways, but generally no.

[–] KindaABigDyl 3 points 1 year ago

Typed. Haskell is the goat

[–] KindaABigDyl 8 points 1 year ago (2 children)

I feel like it's not that it couldn't be removed, but more that it's too low ROI. Devs are expensive

[–] KindaABigDyl 5 points 1 year ago* (last edited 1 year ago) (4 children)

A language designed around the idea of data mutation. Like, just doing data mutation. No functions, no stack, just here's some data and here's how it changes. It's very similar to imperative languages as you might guess, but it basically removes functions from the main data path and simplifies everything which leads to some weird syntax and features.

There are still functions in some ways via a trait system kind of like Rust (also where and polymorphism appears), but it's not quite the same.

I don't really know exactly how to explain it beyond that, so here's a snippet:

[Import]
std

[Data]
a :: Int = 4
b :: Int = 5
a_str :: &Char = []

[Mut]
std.out write "The sum of 4 and 6 is "
b += 1
a += b
a_str alloc_num_str a
std.out write a_str

Not that += here is not equivalent to a = a + b, but rather += is the name of a Numeric trait procedure. Using words I might call it add. It's a add b or with C++-esque syntax it's like (&c)->add(b) or something.

There is a File struct in the std module and a Write trait implemented for &Files that includes a write(&Char) procedure as well as an instance of an &File called "out." So to write a string of characters to stdout, you do std.out write <characters>

So from this, I can say that procedures in traits in this language are like mini versions of the stuff under [Mut] that you can call with parameters. These procedures can also have embedded C code which is how you interact with external stuff and how the core and standard libraries are implemented.

Trait and struct definitions go under [Type] and have their own syntax

Forcing all logic to be an explicit mutation of a singular datum may end up being the worst way to program ever, but it's at least a different way

EDIT: Conceptually this is the same, but the syntax is a bit different now

view more: ‹ prev next ›