Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 503 504 [505] 506 507 ... 636

Author Topic: The small random questions thread [WAAAAAAAAAAluigi]  (Read 674584 times)

methylatedspirit

  • Bay Watcher
  • it/its
    • View Profile
Re: The small random questions thread [WAAAAAAAAAAluigi]
« Reply #7560 on: July 18, 2021, 09:43:41 pm »

Great. It's just Brainfuck with macros and functions. C's "virtual machine" is BF with macros and functions.

(Please check the pronouns; I use they/them)
Logged

Naturegirl1999

  • Bay Watcher
  • Thank you TamerVirus for the avatar switcher
    • View Profile
Re: The small random questions thread [WAAAAAAAAAAluigi]
« Reply #7561 on: July 18, 2021, 09:47:32 pm »

I remember a video about BF years ago, doesna’t it have like, 4 valid symbols?
Logged

methylatedspirit

  • Bay Watcher
  • it/its
    • View Profile
Re: The small random questions thread [WAAAAAAAAAAluigi]
« Reply #7562 on: July 18, 2021, 10:04:17 pm »

I remember a video about BF years ago, doesna’t it have like, 4 valid symbols?

Without looking it up: you have "increment", "decrement", "move pointer left", "move pointer right", "jump to here if current register != 0 when encountering "]" symbol", "jump to '[' symbol if current register != 0", "print the ASCII char for the current register's value", and "get input char, interpret as ASCII value". Did I get it right?

So that's + - < > [ ] . ,

That is your entire instruction set. 8 symbols, and you don't even need the 7th and 8th, technically speaking. I/O is not a requirement for Turing-completeness.
Logged

Naturegirl1999

  • Bay Watcher
  • Thank you TamerVirus for the avatar switcher
    • View Profile
Re: The small random questions thread [WAAAAAAAAAAluigi]
« Reply #7563 on: July 18, 2021, 10:17:07 pm »

It ‘s been a while since I saw it. I’ve never used it, and since that video I think here is where I heard about it again. Question, what does BF start at? Like what does it increment/decrement from? 0?
Logged

Ziusudra

  • Bay Watcher
    • View Profile
Re: The small random questions thread [WAAAAAAAAAAluigi]
« Reply #7564 on: July 18, 2021, 10:24:39 pm »

never mind, misunderstood the question
Logged
Ironblood didn't use an axe because he needed it. He used it to be kind. And right now he wasn't being kind.

Naturegirl1999

  • Bay Watcher
  • Thank you TamerVirus for the avatar switcher
    • View Profile
Re: The small random questions thread [WAAAAAAAAAAluigi]
« Reply #7565 on: July 18, 2021, 10:34:23 pm »

What did you think the question was and what was your answer to said question?
Logged

Ziusudra

  • Bay Watcher
    • View Profile
Re: The small random questions thread [WAAAAAAAAAAluigi]
« Reply #7566 on: July 18, 2021, 10:39:31 pm »

I read "what does BF start at" as "what does BF stand for" and gave a link to the wikipedia page ...

which does answer the actual question:

Quote
The brainfuck language uses a simple machine model consisting of the program and instruction pointer, as well as a one-dimensional array of at least 30,000 byte cells initialized to zero; a movable data pointer (initialized to point to the leftmost byte of the array); and two streams of bytes for input and output (most often connected to a keyboard and a monitor respectively, and using the ASCII character encoding).
Logged
Ironblood didn't use an axe because he needed it. He used it to be kind. And right now he wasn't being kind.

wierd

  • Bay Watcher
  • I like to eat small children.
    • View Profile
Re: The small random questions thread [WAAAAAAAAAAluigi]
« Reply #7567 on: July 19, 2021, 02:39:18 am »

As for why the target MUST be the universal Turing machine---

Let's say you are doing something that would be computationally expensive. Say you are doing some fancy stuff that would benefit from a vectorization process-- So, you use SIMD (Or THUMB, or some other vector processing instruction.) You do this because you would very much like for your program to not take 20 million years to complete.

Suddenly, your program is now x86 only. (Because you used SIMD, which is x86 only.)

The various different implementations of vectorial processing differs in significant ways between different platform ISAs, so you cannot just "Substitute THUMB for SIMD if Platform == ARMv7"-- Especially if your use of SIMD is exploiting some specific behavior of the SIMD ISA.

If you broke that operation up into a serially executed list of sequential instructions, then any universal Turing machine "Could run it"-- they would just run it "Very very slowly".  (which, is the very reason you used the SIMD instruction to avoid!)

Them's the breaks.

C tried to abstract this reasonably--  It left "The devil in the details" to the compiler.  If compiling for ARM, the compiler heuristically interprets your source code, and spits out machine code that targets the THUMB ISA.  If compiling for POWER, it targets altivec ISA.  If compiling for x86, it targets SIMD/SSE.  AND--- if your system is a very minimal SOC with NO VECTOR INSTRUCTIONS AT ALL-- it would unroll everything and do it the super slow sequential process route.

However, again, programmers THINK they are being sly, clever, cute -- "Efficient"-- whatever excuse/reason you want to give--- and will abuse specific quirks of hardware, instead of sticking to the abstraction.  Then the compiler cannot properly interpret it, and thus cannot abstract it into a form some other ISA can handle.  BOOM-- Unportable code.  The usual way they do that, is by in-lining assmbler.

(Another is by doing something VERY platform specific, like "Write #VALUE! -> IO Port FOO".  Such as say, writing a byte value to the VGA hardware's palette table. If you are trying to port that code to some other hardware platform, that has no fucking clue what that is supposed to even DO, the code is not going to have the same end result-- BOOM-- code not portable!)

So, to prevent that, you have to smack their little hands, and say "NO, NO IN-LINE ASSEMBLER."  (also, NO, YOU MUST USE the language/compiler's HAL!! NO DIRECT WRITES TO HARDWARE!)

Keep doing things like that-- which are necessary to assure code portability-- and the programmer gets huffy, and says "No, I wont use your obtuse, backward, and restrictive language!". 

This then resets the problem to the beginning--- Some other language designer sees the problem-- Source code is not portable-- and tries to fix it---- Invents yet another implementation of the minimal code parser, with all its warts and wrinkles, and obtuse requirements..... And nobody wants to use it.

« Last Edit: July 19, 2021, 02:47:32 am by wierd »
Logged

methylatedspirit

  • Bay Watcher
  • it/its
    • View Profile
Re: The small random questions thread [WAAAAAAAAAAluigi]
« Reply #7568 on: July 19, 2021, 03:37:03 am »

Hmm... I was considering "what the programmer put in the effort to write multiple architecture-specific code paths, as well as a generic fallback one?". But that would actually imply that programmers want to put in extra effort for something they're never gonna encounter themselves.

But wait, what's stopping the standard and the compiler of such a hypothetical language from saying "Bad programmer! No! Bad!" every time they do something that could trigger undefined behavior? (I think I've just described Rust by accident.)
Logged

McTraveller

  • Bay Watcher
  • This text isn't very personal.
    • View Profile
Re: The small random questions thread [WAAAAAAAAAAluigi]
« Reply #7569 on: July 19, 2021, 07:05:33 am »

Here's the thing with Java:

Some platforms did java vm as hardware. They could run java 'natively'.


I put that squarely in the category of things people did because they could, not because of any particular value in so doing.  8)
Logged

methylatedspirit

  • Bay Watcher
  • it/its
    • View Profile
Re: The small random questions thread [WAAAAAAAAAAluigi]
« Reply #7570 on: July 21, 2021, 07:49:30 pm »

Does anyone have Discord invites for the multiple Bay12 Discord servers? I'd like to join at least one server because I realize that I'm growing quite far apart from the forum itself, yet I do miss y'all. (PM me the links, for very obvious reasons regarding privacy.)
Logged

Ziusudra

  • Bay Watcher
    • View Profile
Re: The small random questions thread [WAAAAAAAAAAluigi]
« Reply #7571 on: July 21, 2021, 08:35:18 pm »

There is a Kitfox approved invite link for the official Kitfox Games Discord on the front page of the wiki. I don't currently use Discord so I don't have access to the others.
Logged
Ironblood didn't use an axe because he needed it. He used it to be kind. And right now he wasn't being kind.

KittyTac

  • Bay Watcher
  • Impending Catsplosion. [PREFSTRING:aloofness]
    • View Profile
Re: The small random questions thread [WAAAAAAAAAAluigi]
« Reply #7572 on: July 21, 2021, 10:37:33 pm »

That one and the one you just joined are, in fact, the only major servers I think.
Logged
Don't trust this toaster that much, it could be a villain in disguise.
Mostly phone-posting, sorry for any typos or autocorrect hijinks.

Vector

  • Bay Watcher
    • View Profile
Re: The small random questions thread [WAAAAAAAAAAluigi]
« Reply #7573 on: July 22, 2021, 01:25:46 am »

Does anyone have Discord invites for the multiple Bay12 Discord servers? I'd like to join at least one server because I realize that I'm growing quite far apart from the forum itself, yet I do miss y'all. (PM me the links, for very obvious reasons regarding privacy.)

:<

I somewhat suspected that many of us returned during lockdown and would disperse afterwards.
Logged
"The question of the usefulness of poetry arises only in periods of its decline, while in periods of its flowering, no one doubts its total uselessness." - Boris Pasternak

nonbinary/genderfluid/genderqueer renegade mathematician and mafia subforum limpet. please avoid quoting me.

pronouns: prefer neutral ones, others are fine. height: 5'3".

wierd

  • Bay Watcher
  • I like to eat small children.
    • View Profile
Re: The small random questions thread [WAAAAAAAAAAluigi]
« Reply #7574 on: July 22, 2021, 01:45:02 am »

At the rate Delta is proliferating, I would not be surprised for lockdown 2.0 after November.
Logged
Pages: 1 ... 503 504 [505] 506 507 ... 636