I'm looking for multithreading support for Lua/LuaJit.
I found http://lua-users.org/wiki/MultiTasking a lot of varians of modules, but I can't find up-to-date module.
Can somebody provide me the most useful Lua-threading? It is hardly difficult to find and choose.
I'd use cqueues.thread. It doesn't come with as much automatic serialisation/deserialisation as other solutions. But IMO it's a simpler model. Doesn't work on windows though.
Related
This question is about design / is fairly open-ended.
I'd like to use OpenCV, a large C++ library, from Haskell.
The closest solution at the moment is probably Arjun Comar's attempt to adapt the Python / Java binding generator.
See here, here, and here.
His approach generates a C interface, which is then wrapped using hsc2hs.
Due to OpenCV's lack of referential transparency in its API, as well as its frequent use of call parameters for output, for Arjun's approach to fully succeed he'll need to define a new API for OpenCV, and implement it in terms of the existing one.
So, it seems it might not be too much extra work to go whole-hog and define an API using an interface description languages (IDL), such as SWIG, protobuf-with-RPC, or Apache Thrift.
This would provide interfaces to a number of languages besides Haskell.
My questions:
Is there anything better than SWIG for a server-free solution?
(I just want to call into C++; I'd rather not go through a local server.)
If there's no good server-free solution, should I use protobuf-with-RPC or Thrift?
Related: How good is Thrift's Haskell support?
From the code, it looks like it needs updating (I see references to GHC 6).
Related: What's a good protobuf-with-RPC solution?
With Apache Thrift, you get Haskell support. You are correct, code is not generally "latest", but you rarely care. You can do complex things on other abstraction levels and keep things as simple as possible at messaging level.
Google Protobuf has no support for Haskell, nor does SWIG. With Protobuf you get C++, Java, JavaScript and Python, to my knowledge the main languages at Google. Have a look at this presentation. Without contest, Thrift and Protobuf are the best in house.
It seems in your case you have to go with Thrift, as it supports Haskell.
It sounds like the foreign function interface for C++ is what you want:
Hackage,
Github
Disclaimer: I haven't used it, only heard good things about it.
I've been playing around with "Gloss" for a day now but I feel like my possibilities are very limited.
Can you recommend a more powerful library?
If there is a simple 3D library, I'd like to use it but if it gets significantly more complex then I'm also fine with staying at 2D for the moment. I can't exactly tell you what I expect from the new library but it should be more flexible and provide more (advanced) features.
PS: I'm on Windows 7 64bit if that matters
I think the question may be a little vague and "more powerful" is certainly subjective. But since you mentioned that you were on Windows 7-x64 then I can only guess to point you towards HGamer3D as a possible solution. I've heard some good things about it, but I've never used it myself. In any case there looks to be plenty to chew on there.
OpenGL.
An introductory tutorial, by Mikael Vejdemo Johansson,
loosely based on the tutorial by Sven Eric Panitz.
Googled a little bit, but still not sure whether there is some standard library in Haskell dealing with inter-process communication stuff, since I am new to Haskell, I also hope that the library is well documented, better some small example (e.g. passing some data types and use them)....
Many commercial and open source IPCs have Haskell bindings:
0MQ
Thirft
Messagepack
I have made the best experiences with Messagepack because it is quite light weight.
I've created a simple library to solve the most basic aspects of this problem: http://hackage.haskell.org/package/ipcvar
This may not be for this forum, but...
We write new system and people are used to older system where components are called "modules". So they talk about the accounting module and the auditing module, etc...
This feels very old, like cobol/mainframe talk. What would be better term for functional components in a modern-distributed java system? Would you say the accounting component? The accounting service? Not sure. They refer to the function in the system (and all components behind it) that allow you to perform accounting functions.
If it ain't broke, don't fix it.
The fact that you are asking SO for advice on this suggests that you don't have a better nomenclature ready to use. Spend your time doing something more productive than fretting about this.
I think that "module" is a perfectly reasonable way to refer to a set of functionality. It's still widely used in many languages and frameworks. If it sounds "old" it's only because of your own frame of reference.
Besides, the customer is always right. You should be adopting their verbiage instead of trying to force them to use yours. Do what you want internally but stick with "modules" for the customers' sakes.
Python, a thoroughly modern programming language, has "modules." I don't think there is anything archaic about the word.
If users are used to calling things in the old system "modules," then it will make the new system easier to learn if you use the same terminology.
bundle is the new term ;-) ofcourse coined by OSGI. But when you say bundle then lot of assumptions are made on your code. So whether you want to use this or not is left to you.
I'm interested in learning about Boo's more powerful features such as syntactic macros, parser support (Ometa?), compiler pipeline, etc. My impression is that these areas have been in flux and somewhat under-documented. Are there any good resources for learning about these things other than studying the source code?
ask code gardener / boo author #rodgrigobamboo!
"boo metaprogramming facilities I - the ast".
There's Building Domain Specific Languages in Boo. I got an early early access edition and found it frustrating for the "flux" reason you mentioned; I finally gave up. Hopefully things have stabilized since then.
Feel free to ask questions on the mailing list:
http://groups-beta.google.com/group/boolang?pli=1
By far the best reference to see what Boo can do is to spend a bunch of time going through the tests. It takes a while to puzzle out what's going on, but the tests really do flex all of the muscles that are available and are quite well written.
https://github.com/bamboo/boo/blob/master/tests/testcases/macros/macro-1.boo
Also, note that boo's interpretter- booish- is really excellent and if you're not sure how a test works, you should probably spend time in booish prodding at it.
http://boo.codehaus.org/Interactive+Interpreter
I haven't looked through this site extensively, but it appears it may have the best references for Boo:
http://boo.codehaus.org/Tutorials
This section is still not well documented but if you look at https://github.com/bamboo/boo/wiki/Syntactic-Macros you can see how to make syntactic macros. Basically you have to implement Boo.Lang.Compiler.IAstMacro.
The correct section is in https://github.com/bamboo/boo/wiki/Abstract-Syntax-Tree but it largely seems incomplete.