Comparing Strings is Hard (Porth Ep.22)

preview_player
Показать описание
References:

Support:

Feel free to use this video to make highlights and upload them to YouTube (also please put the link to this channel in the description)
Рекомендации по теме
Комментарии
Автор

Always saying "so on and so forth" but should say instead "so on and so porth".

etienneparcollet
Автор

The type of "temporary storage" that Forth uses is a stack; Forth actually has two of them - the data stack and the return stack. The return stack is generally used for return addresses, but it's not uncommon to push data onto it temporarily.

hikingpete
Автор

I think, it could be quite useful to have a 'stack' instruction that works like 'mem' but returns the current stack pointer instead.
With that, you could then use macros to implement any additional dup / swap stack operations.

CDBE
Автор

Hello, nice to see you're back. I was worried because of the silence on the TSCoding channel.

DJohn
Автор

Do you think you would do a video where you show your keyboard input? I'm genuinely curious what's happening there

NetherFX
Автор

Would be nice if when you dropped something “I assume it is just a pop eax, can’t look right now.” That you then had a suite of “counter intrinsics” that would interact with whatever register drop pops to.. then your stack is free and you can pass/use counter variables in a register.

GiveAcademy
Автор

Just started the episode and wondering if you implement REP/REPE/REPZ/REPNE/REPNZ assembly instructions for comparing strings. ;)

GiveAcademy
Автор

28:17 How does streq destroy the strings? It doesn't seem to do any writing to memory. Shouldn't the strings be perfectly preserved after streq? It looks like it could even be designed to take a memory string and a literal string as arguments instead of two memory strings.

Ansatz
Автор

If you can introduce a new 2over intrinsic with semantics a b c d -- a b c d a b then I think streq can be implemented without the additional variables:

if rot 2over = do
rot 0 while
if 2dup < do
2over rot dup rot + @8
rot rot dup rot + @8
rot =
else false end
do 1 + end
>=
rot drop rot drop swap drop
else
drop4
false //lengths don't match
end

bonus, you can do this without consuming the strings if you get rid of the drops at the end

realvatican
Автор

44:50 You should add stack visualuzation to the debugging tool

aanginer
Автор

I don't really get how the macros r used as memory.

bigmistqke
Автор

From @19:30 why not to do the following?
Swap rot swap
2swap swap rot
2dup + @8
2swap swap rot
=

And after consuming the condition:
Swap 2swap swap rot

Protoex
Автор

what is the name of the font you are using?

ВладМовлатов-цх
Автор

You write code that is very *error porn*

yhdcvee
Автор

he had cstreq. Just make pstr-to-cstr and call cstreq bruh

aanginer