ADTs in Ceu

23 views
Skip to first unread message

Francisco Sant'anna

unread,
Mar 19, 2022, 1:13:32 PM3/19/22
to ceu-...@googlegroups.com
Hi,

I've been working in the language and did some experiments with ADTs to support subtyping and inheritance:

Job van der Zwan

unread,
Mar 19, 2022, 4:32:44 PM3/19/22
to The Programming Language Céu
Oh, that looks very nice! I'm curious what the purpose of the index-based syntax is though? I cannot imagine ever using it instead of the explicitly named fields, it feels like it's combining the worst of "magic numbers" with ADTs.

Francisco Sant'anna

unread,
Mar 19, 2022, 6:39:50 PM3/19/22
to ceu-...@googlegroups.com
On Sat, Mar 19, 2022 at 5:32 PM Job van der Zwan <j.l.van...@gmail.com> wrote:
Oh, that looks very nice! I'm curious what the purpose of the index-based syntax is though?

The main purpose is to be symmetric with tuples and also to provide a lower level representation.
 
I cannot imagine ever using it instead of the explicitly named fields, it feels like it's combining the worst of "magic numbers" with ADTs.

You could use it inside narrow scopes for very simple types (e.g. Either):

var x: <Int,Int>   -- either error or success
... set x = <.2 v> -- success
... if x?2 ....

Also, code generation.


 

On Saturday, 19 March 2022 at 18:13:32 UTC+1 Francisco Sant'Anna wrote:
Hi,

I've been working in the language and did some experiments with ADTs to support subtyping and inheritance:

--

---
You received this message because you are subscribed to the Google Groups "The Programming Language Céu" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceu-lang+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceu-lang/9dc3407e-2f35-443c-917c-5337e43ebaf7n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages