Hacker Timesnew | past | comments | ask | show | jobs | submit | jmillikan's commentslogin

Also useful for pretending chat-bots are broken.


Calling Java from frege isn't hard, but there isn't currently a way to directly implement interfaces or inherit abstract classes in just frege. You can create a sort of proxy in Java (or whatever) and implement methods in frege, but it's not pretty. (I think; I haven't quite comprehended the examples.)

The article at https://mmhelloworld.github.io/blog/2013/07/10/frege-hello-j... talks about this, but doesn't quite explain the proxy mechanism, it just points out an example.


> but there isn't currently a way to directly implement interfaces or inherit abstract classes in just frege.

Not quite true anymore. TO be sure, some (inline) java will still be needed.

Here is an example https://github.com/Frege/frege/blob/master/tests/comp/Issue2... which compiles to a class that implements java.util.Comparator. Instances thereof can be created from Frege by passing a custom comparision function and could be passed to Java.

The example would be useful in cases when you have Frege data in a Java collection and want to sort them. But it is merely there to show the possibilities.


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: