Re:Show HN: Fe – A tiny, embeddable language implemented in ...
by TurboHaskal on Sunday April 05, 2020 @11:40AM
(#22786181)
Grep for "Exporting Types in ATS for Use in C" in http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/...
Re:Show HN: Fe – A tiny, embeddable language implemented in ...
by jcelerier on Sunday April 05, 2020 @02:37PM
(#22787433)
typedef
struct {
int atslab__0; void *atslab__1;
} int_and_string ;
very strong typing right there...
Re:Show HN: Fe – A tiny, embeddable language implemented in ...
by caspper69 on Sunday April 05, 2020 @04:49PM
(#22788597)
I apologize for being ambiguous. You wouldn't gain the benefits of ATS by interfacing with its C bindings from C. You would gain safety and security in interfacing with unsafe C on the ATS side through the ATS type system.
I was speaking about interfacing in the opposite direction.
Re:Show HN: Fe – A tiny, embeddable language implemented in ...
by thethirdone on Monday April 06, 2020 @01:25AM
(#22791105)
> I apologize for being ambiguous.
No need to apologize. I also should have been more clear about what I meant by strong interoperability.
> I was speaking about interfacing in the opposite direction.
I think that having really strong interoperability requires both directions, but the being called from C is the one that is more restrictive on fancy types.
Re:Show HN: Fe – A tiny, embeddable language implemented in ...
by caspper69 on Monday April 06, 2020 @04:10AM
(#22791748)
Unfortunately, C is C, and we all know what that means. Anything that achieves true type safety in both directions in going to be a monstrosity on the C side. Lots of boilerplate, marshalling of types, etc.
It all starts to look like COM, lol. Take care man.
My idea of strong interop is not having to write any glue code at all and being able to call any function. I assume there are some types that don't interface with C well.
That said, thanks for mentioning it. I should keep it in mind as it does do some of the stuff I want my language to.