Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Functional programming and ownership are concepts that just don't mix well.

Of course they do, ownership is part of substructural type systems, more precisely affine types.



The particular problem I was getting at was that the structural sharing required by purely functional data structures is not a natural or easy task when you're restricted by affine or linear types.

Several idiomatic functional programming techniques are similarly difficult to express with the additional invariants of affine types.


Yet there are quite a few programming languages considered functional with substructural type systems.

Being easy or hard is not what defines FP.


Well, that was in the context of the claim that "Rust is very much ML". We weren't talking about (say) BitC here.

I've got nearly two decades worth of ML code lying around (mostly OCaml, some SML and F#) and for most of it rewriting it in Rust would require significant redesign for the reasons I mentioned. This starts with even very simple things like List.rev.


> We weren't talking about (say) BitC here.

No, we are talking in the context of ATS, LinearML, Idris, Mercury, F* and a few others.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: