agentm / project-m36

Project: M36 Relational Algebra Engine
The Unlicense
894 stars 48 forks source link

tutd 15 minute tutorial issues #269

Closed ValeTheVioletMote closed 3 years ago

ValeTheVioletMote commented 3 years ago

Hi,

Found your project after listening to many an hour of Date. Haven't been able to touch it until now, many months later. Went to try out your 15 minute tutorial, but a few issues arose. I'm using docker for reference.

:importtud "scripts/DateExamples.tutd"

Is a misspell of:

:importtutd "scripts/DateExamples.tutd"

But that still gives me ERR: ImportError "scripts/DateExamples.tutd: openBinaryFile: does not exist (No such file or directory)" on my Docker server.

It didn't like:

x:=relation{name Text, age Int}{tuple{name "Steve", age 40},tuple{name "Mike", age 31}}

I got:

ERR: AtomTypeMismatchError IntAtomType IntegerAtomType

After changing 'Int' to Integer, it worked.

Then I got down to the part where you say:

Note that the relational insertion is identical to "x:=x union relation{...}".

That piqued my interest. So I wrote

x := x union relation{tuple{name "James", age 19}}

And this seems to stall the program/make it unresponsive/crash it.

Even something as simple as:

:importexample date
s := s

produces the same effect.

Also, it'd be nice to know in this tutorial how I can affect multiple relvars at once.

It appears that this operation runs into a foreign key constraint:

TutorialD (master/main): delete s where ^lt(@status, 20)
ERR: InclusionDependencyCheckError "s_sp_fk"

But frankly, I'm left clueless as to how to properly execute this.

I recognize this project is a monumental effort, that this is primarily geared toward Haskell and not tutd, but I am desperate for a relational take with your view on answering the NULL problem that I can use as general purpose. I am excited by the websocket server, and I'm looking forward to see where M36 continues to propel itself.

Thank you for everything you're doing for the relational community.

agentm commented 3 years ago

Hi @ValeTheVioletMote! Thanks for the detailed report. I've fixed the documentation issues you raised. If you like, please review the changes.

The x:=x should work, but apparently the tests do not cover this case. I will fix that shortly.

ValeTheVioletMote commented 3 years ago

Thanks, the doc changes look good.

It is a bizarre issue. It's my understanding that Haskell is exception-free, so to encounter an error that simply stalls the machine must be difficult to debug.

agentm commented 3 years ago

I mistakenly didn't test the relational variable self-reference which leads to an infinite loop. It should be simple to fix.