You mean I forget / at the start if it's an absolute path?
@RydwolfPrograms imo Rust isn't much like JavaScript
I feel it's more like someone told C++ to go f*ck itself, so it did, and Rust was the product. Thankfully, the government took Rust away from C++ and handed it over to Haskell to raise
@AidenChow fun fact: if it wasn't for 2x-1, I wouldn't have come back to code golf in early 2019, I wouldn't have ever made a sbcs esolang and I wouldn't have stuck with the golfing language design grind as long as I have :p
That's my point. You might not even need to know what that is to make a language
(but to answer the question: a lexer says "hey this bit of text is a number, that bit is a string, oh hey and this bit of text is an opening bracket" and so on. A parser says "hey this number, operator and number are a single unit of stuff imma group that together". A visitor approach says "I'll start at this group of stuff, move to the next stuff and so on and each group of stuff might be handled differently")
the entire process of lang design sounds like super long and pain... like im literally gonna run into a million bugs before i even get simple program running
It's not. You start with "if I get command x, I do something. If I get command y, I do something else..." and then figure out how to break things down into command x and command y
There's no right way to do it. Sure there's ways which aren't as scalable or easy as others, but as long as it works
You must evaluate a string written in Reverse Polish notation and output the result.
The program must accept an input and return the output. For programming languages that do not have functions to receive input/output, you can assume functions like readLine/print.
You are not allowed to use any...
We have these two shapes:
#.
##
and
.#
##
Let's call the first shape the L and the second shape the flipped L.
On a 4x4 board, there are 16 cells. Each cell can be either free or occupied. In all the illustrations, # represents an occupied cell and . represents a free cell.
Your job is to print...
Background and Rules
There is a variant of chess called atomic chess, which follows essentially the same rules as normal chess, except that pieces explodes other pieces around them when captured. In addition to checkmate, you can also win the game by blowing up the king.
When a piece captures an...
The issue is that most C programs don't properly state what you need to define to actually make them work, and vaguely say "yea you need library X" but no version information or where to find X
LDQ: What should Rabbit's imports look like? Part of the problem I'm having with my type-resolution system is that I myself am not sure how the imports should work
@mousetail get this: I don't need import errors at all, because carrot guarantees that all dependent modules are available before the program even launches
@user Syntactically? No. But they use the same naming for iter methods, have a basically identical async/await system (on the surface), and in various other small ways feel JS-y
@mousetail because you might have modules that export things in the crate, but aren't used anywhere directly in the crate, and the Rust compiler can't distinguish between those and any random .rs files that you happen to have lying around and don't want to include in the project