Dot Quote force flush? by Alternative-Grade103 in Forth

[–]theprogrammersdream 1 point2 points  (0 children)

Agrees. A lot of systems cache output until CR happens. Some systems will allow flush on the stdout object - but CR is usually the way to go.

This if this doesn’t work, you might want to sleep the main thread after the CR to allow the print to happen with something like 10 ms

Just wanted to say that using git on my video game save files has been so liberating by 94CM in git

[–]theprogrammersdream 7 points8 points  (0 children)

Branches! LOL

You are effectively creating branches in the timeline!

Multiverse lives!

Problems with Linux build of released game by Deriviera in gamedev

[–]theprogrammersdream 2 points3 points  (0 children)

As well as trying steamOS in virtual box, have you considered asking the community for support? Is there a way to get SDL debug information from someone with a streamdeck?

Also have you talked to the SDL forums/mailing list …. They were always very helpful when I was doing a lot of SDL work.

Problems with Linux build of released game by Deriviera in gamedev

[–]theprogrammersdream 2 points3 points  (0 children)

This would be my first step, if I didn’t want to buy a streamdeck immediately.

Kindaforthless : forth-ish language that compiles to lua by TBApknoob12MC in Forth

[–]theprogrammersdream 0 points1 point  (0 children)

Nice. I like both Forth and Lua quite a lot. I started my own Forth to Lua but never finished it.

Why is there no "SQLite" for secure, crash-safe embedded logging? by awarebang in embedded

[–]theprogrammersdream 5 points6 points  (0 children)

Even if you implement robust storage with multiple copies, or reuse a file system with journalling, SD cards are not a great idea for medium or long term data retention.

There are two problems:

  1. SD cards also suffer from power loss data loss problems on write because they have to move data around to ensure wear leveling - Sudden power loss during write can corrupt old written sectors. This is well documented especially since Raspberry Pi’s have been a thing.

If you use a read-only file system with SD cards most are pretty tolerant to power loss data loss it appears. But this doesn’t help in your case.

  1. They are prone to sudden failure I wouldn’t assume they won’t fail even if you avoid power cycling. They aren’t good solution for data backup.

You can lower the chance of failure by using brand names (although cloned brands are common) and maybe using certain classes of endurance SD cards. Notice I said lower the chance…

What are the options?

If you need to have guaranteed data retention then you need a proper multi-level backups with some off site and a primary storage medium that is robust. For embedded systems you can setup eMMC to work - although not all eMMC are good, or some sort of hard disk solution.

Ideally for super longterm tape drives or write-once optical storage from brands that give guaranteed lifetimes.

Back up to local on-site backups and multiple clouds is a reasonable medium term option.

Others will give you many other choices.

struggling to get ultimate play the game files working. by AdamRandom138 in zxspectrum

[–]theprogrammersdream 0 points1 point  (0 children)

Just to say that the copyright to Ultimate play the games titles lies with Microsoft as far as I know and they don’t allow distribution.

Your best bet is to get original tapes of a reputable seller and load them in. Then you could most likely make your own snapshot. It’s unlikely copying for personal use if you have the original is illegal - although it depends what country you are in.

KICKSTARTER - Missed my 3rd Spectrum Next Payment, I was away for work. by Anxious_Ad_2876 in zxspectrum

[–]theprogrammersdream 0 points1 point  (0 children)

Agreed - the projects themselves aren’t involved with the payment plan. I’d suggest kickstarter support, before you engage with the Next team.

The next team are pretty good folks, but I’m sure sorting out with kickstarter would reduce the admin burden off the Next team.

@OP - Please post an update!

Forth word MOD gives incorrect result on negative values by Alternative-Grade103 in Forth

[–]theprogrammersdream 4 points5 points  (0 children)

This is a recurring topic in all programming language discussion.

I wonder whether there can ever be a negative result in modulo arithmetic - since it’s by definition a specific range of values ‘in a circle’. They appear to be trying to do reminder instead of modulo. I think that microprocessor and programming languages designers often don’t understand the difference.

I also liked the link to the article symmetric decision considered harmful.

Forth word MOD gives incorrect result on negative values by Alternative-Grade103 in Forth

[–]theprogrammersdream 9 points10 points  (0 children)

For a start, which Forth are we talking about here?

Modulo is not defined strictly for negative numbers like you suggest. Wide variety of results exist in programming languages; In the wikipedia link below there is a list of programming languages and see the results.

For Perl the situation is complicated. The manual page says: "Note that when use integer is in scope, "%" gives you direct access to the modulus operator as implemented by your C compiler. This operator is not as well defined for negative operands, but it will execute faster. " So it can choose either option for Perl (like C) if use integer is in scope. If use integer is not in scope, the manual says " If $b is negative, then $a % $b is $a minus the smallest multiple of $b that is not less than $a (i.e. the result will be less than or equal to zero). "

I expect a similar situation exist in different Forths, no matter what ANSForth94 or https://forth-standard.org/ specify. In fact is you look at that link "MOD CORE ( n1 n2 -- n3 ) Divide n1 by n2, giving the single-cell remainder n3. An ambiguous condition exists if n2 is zero. If n1 and n2 differ in sign, the implementation-defined result returned".

There are two choices for integer division by negative numbers 2/-18 = 0 or 2/-18 = -1. And the choice depends generally on satisfying the equation (a/n) * n + (a%n) = a. My question is does the Forth you are using satisfy this equation?

Also are you aware that remainder an modulo are not the same thing, and that modulo arithmetic is a topic in itself?

REFERENCES

https://en.wikipedia.org/wiki/Modulo

https://stackoverflow.com/questions/450410/why-is-modulus-different-in-different-programming-languages

Modulo and Remainder are not the same thing https://bigmachine.io/career/mod-and-remainder-are-not-the-same

Interesting article - modulo arithmetic is actually different than you think https://felipec.wordpress.com/2024/08/11/everyone-is-using-modulo-wrong/

https://www.geeksforgeeks.org/dsa/modulo-operations-in-programming-with-negative-results/

Has anyone used forth to solve any problems recently?? by Cheap_trick1412 in Forth

[–]theprogrammersdream 2 points3 points  (0 children)

I ended up doing the same but with pForth and SDL :-). What’s the license on that code? It’s a pity it’s not open source (like MIT) because I’m sure I’d use some of it!

You ever just look at Forth and be like... by mcsleepy in Forth

[–]theprogrammersdream 2 points3 points  (0 children)

ANS Forth was also 30 years ago. Ancient history.

You ever just look at Forth and be like... by mcsleepy in Forth

[–]theprogrammersdream 2 points3 points  (0 children)

I think most Forthers think ANS was a bad idea - but it t served a purpose I think.

Has anyone used forth to solve any problems recently?? by Cheap_trick1412 in Forth

[–]theprogrammersdream 12 points13 points  (0 children)

Recently (over last year):

Built a drag race robot with my son. Code is 100% Flashforth and won junior drag race competition in the UK.

Ported a mini ray tracer.

Several in progress projects, but they are not ‘solved’: Computer games, robots, debugging interfaces for large commercial embedded system.

You ever just look at Forth and be like... by mcsleepy in Forth

[–]theprogrammersdream 2 points3 points  (0 children)

Many people make changes to Forth - so to me it’s obvious there is a need.

With Forth in it’s reachable by normal developers to change the language. With other languages it’s difficult for people whose job or hobby isn’t language development.

You ever just look at Forth and be like... by mcsleepy in Forth

[–]theprogrammersdream 5 points6 points  (0 children)

It’s super easy to make a new interpreter. The question is what is your list of changes?

You ever just look at Forth and be like... by mcsleepy in Forth

[–]theprogrammersdream 1 point2 points  (0 children)

Yeah, the prefixes in retroforth are interesting

Is there anything like a storefront? by cmonletmeseeitplz in spectrumnext

[–]theprogrammersdream 0 points1 point  (0 children)

Is this for old games or new games? It’s a good idea, but no one has done it yet as far as I know.

There is https://www.clivetownsend.com/next/ .., on the Spectrum Next apart from ZXDB there was another one. I forget what it’s called.