[Home] [Overboard] [Catalog] [Search] [Thread list] [Inbox] [Write PM] [Admin]
[Return] [Home]


/λ/ - Programming

[]
Do we have any awesome /prog/ runners here? :0

cybersecurity bros also welcome
[]
i make spaghetti code for little games ヽ(´∇`)ノ
[]
>13888
that's fun! do u have any to share? \(^o^)/
[]
im trying to code a textboard from scratch with my 2 remaining neurons (´・ω・`)
[]
The ! (NOT) operator only has one operand. If the operand is true, the result is false. If the operand is false, the result is true. The result is also known as a 1's complement, or we've just inverted the state of all the bits.

The ~ (1's complement) operator inverts the bits in the word.

If we look at the operands as byte values, we have something like:
```
00000000 & 00000000 = 0
00000000 & 00000001 = 0
...
```
BUT, we have 8 bits, so the operation is performed on all 8 bits in the two operands.
```
10000000
OR 00000001
--------
^ ^
= 10000001
^ ^

NOT 10000001
= 01111110
```
This is a most important concept to grasp!

We use the Boolean Algebra operators on words to achieve useful results.

A typical use of the AND operator is to clear bits in a value. If we AND with a value that is the inverse of a power of 2, we are simply clearing a bit. n AND !4 clears bit 3 in n.

A typical use of the OR operator is to set bits in a value. If we OR with a value that is a power of 2, we are simply setting a bit. n OR 4 sets bit 3 in n.

A great use of the AND operator is to do a modulo of a number to a power of 2. For example, AND with 3 gets you a result between 0 and 3. AND with 7 gets you a result between 0 and 7.

WTF(╬⊙Д⊙)
[]
has anyone used FORTH before? I've been experimenting a lot with it, I really love it
[]
>>13896
I want to learn Forth.
[]
>13888
mmm, spaghetti are yummy(´ー`)
[]
Forth is extremely cool, but ultimately impractical. The mental load it implies (from keeping the stack ops in your head) is exactly equivalent to the mental load of raw assembly language on x86_64 (e.g. register juggling and such).

My conclusion is that the Forth backend, with very few improvements (such as a hierarchical dictionary system) is ideal, but a frontend more akin to lisp (or opendylan actually) is superior for reducing mental load and thus boosting productivity.

That's what I'm doing with the programming language I'm developing.

That said, I've also been playing around with is that some amount of mental load is required to improve programming performance (because it forces the brain to engage in deeper thoughts than usual, which may result in a better overall grasp of errors before hitting run or compile). If this theory is correct, then maybe Forth is optimal on that front, too. This means the best language EVAAARRR is Forth with your custom functions speeding up compilation.

In any case, I think Forth is the coolest language ever made, even if it requires a genius (like Chuck Moore) to be maximally productive with it and I'm not quite on that level myself.

P.S.: I wrote a Wirthian (single-pass) compiler for a turing-complete lisp-like language purely in x86_64 assembly language with at&t syntax, that compiles directly to valid ELF64 binaries. This means you should ignore my opinion and comments because I am masochistic. (´人`)
[]
computer >:3
[]
compter ヽ(´ー`)ノ
[]
cum put her banana
[]
I dedicate a poem to all programmers

i program but i think my code could be better
everyday my code is getting fatter
so i get a job to learn some more and be all fine
but i find that the company's code is even worse than mine
[]
>>14044

Heres my Haiku

"I code all day long..."
"I was hoping to be paid"
"...But my job out-sourced"
[]
clickety clack clack I'm decoding the system override on the mainframe's hyperdrive
[]
yes i totally know about computers most definitely. (´・ω・`)
[]
i write a lot of analytical/administrative tools, it's fun, lots of SQL, i enjoy (^Д^)


New reply

(for deletion, 8 chars max)