Hacker News new | ask | show | jobs
by upghost 506 days ago
You can embed GNU APL. I did it once with Clojure[1], tho it wasn't too popular. If they hired you to do Python should probably do that instead of embedding APL into Python. (I don't follow my own advice)

I would love to embed Dyalog but last time I tried I wasn't smart enough. If anyone from Dyalog feels like throwing cycles at it let me know!

[1] https://github.com/jjtolton/libapl-clj

1 comments

Dyalog is a .Net language do you can write classes in APL and export DLLs that you can use from C# or F# from something like ASP.Net web servers.
Very cool! I don't quite know how I would use that to fully embed Dyalog. Very large class..?
What do you mean by "fully embed"? The integration is a 'bridge', the Dyalog engine stays involved. The simplest way is to make a class and method that takes a string and ⍎ evals it as APL code and returns the result, and call that from C#. From there, you could write more and more APL code and make wrapper methods to expose an API of methods that C# can call.

They have a .NET Interface document: https://docs.dyalog.com/latest/dotNET%20Interface%20Guide.pd...

And more general documentation: https://www.dyalog.com/documentation_190.htm including one for classic Windows .NET (instead of .NET Core) and one "APL As A Shared Library" which is about integrating with other systems using C (making a C .DLL) instead of .NET.

Ahhh this is fantastic. Exactly what I was looking for. As I said before not that smart, but hopefully a little smarter than I was before. The shared library documents, if I can figure them out, would allow for a libdyalog-clj, which would be extremely exciting. To me, anyway, and maybe like six other people haha.

Thank you, jodrellblank, for being patient with me and for this information.