Does the Julia Language have Event Management/Handling Functionality, and if yes, how would you implement it in your program(syntax)?
Note: I am aware of packages DiscreteEvents.jl and am Inquire about built in functionality that comes with the language and not through third party packages.
Related
I recently looked into the usage of GPU computation, where the usage of package seemed to be confusing.
For example, CuArrays and ArrayFire seemed to be doing the same thing, where ArrayFire seemed to be the "official" package on Nvidia developers' webpage.(https://devblogs.nvidia.com/gpu-computing-julia-programming-language )
Also, there were CUDAdrv and CUDAnative Packages..., which seemed to be confusing, as their functionality seemed to be not as straightforward as the others.
What does these packages do? Is there any difference between CuArrays and ArrayFire?
As explained in the blog post you shared, it is quite simply as given below
The Julia package ecosystem already contains quite a few GPU-related
packages, targeting different levels of abstraction as Figure 1 shows.
At the highest abstraction level, domain-specific packages like
MXNet.jl and TensorFlow.jl can transparently use the GPUs in your
system. More generic development is possible with ArrayFire.jl, and if
you need a specialized CUDA implementation of a linear algebra or deep
neural network algorithm you can use vendor-specific packages like
cuBLAS.jl or cuDNN.jl. All these packages are essentially wrappers
around native libraries, making use of Julia’s foreign function
interfaces (FFI) to call into the library’s API with minimal overhead.
CUDAdrv and CUDAnative packages are meant for directly using CUDA runtime API and writing kernels from Julia itself. I believe that is where CuArray come in handy - wrapping native Julia objects into CUDA accessible format, roughly speaking.
ArrayFire on the other hand is a generic library that wraps around all(cuBLAS, cuSparse, cuSolve, cuFFT) CUDA provided domain specific libraries into nice interface(functions). Apart from the interface to CUDA's domain specific libraries, ArrayFire by itself provides lot of other functions in the areas of statistics, image processing, computer vision etc. It has nice JIT feature where user's code is compiled to a runtime kernel - simply put. ArrayFire.jl is an language binding with some extra Julia specific improvements at wrapper level.
That's the general difference. From a developers perspective, using a library(like ArrayFire) basically takes out the burden of keeping up with CUDA API and maintaining/tweaking the kernels for optimum performance which I think takes lot of time.
PS. I am a member of ArrayFire development team.
Is it possibly to use the Qt toolkit with Julia?
I've read that Julia supports calling c and python functions. How would I go about using pyqt/pyside or c's Qt bindings from within Julia?
The most stable option right now is to call PySide via Python, for which there is already a meta-wrapper with some helpful functions (event loop integration, etc.).
Longer-term, there is a C++ FFI under development, and it has a very minimal demo of calling Qt directly from Julia. If you are feeling adventurous, this could be something to look at, but understand that it is still pre-release software so be prepared to file bugs and don't be surprised if some features are not available yet.
We are developing a library for complex event processing.
Is there any standard or widely accepted language with clear semantics that we could based on?
After some research it seems all available options are vendor/platform specific.
Yes there is no common CEP language now, Most of the venders are either using a SQL like language or a UI based tool.
SQL like language seems to be the more feasible approach due to easy of development of a CEP engine,
We have tried to come up with a SQL like language for a Java based CEP engine.
This might be helpful for you.
Suho
It looks to me that qthaskell is not being actively developed/ is abandoned.
Does it support QtQuick ?
Are there plans / any development in supporting qt 5 ?
Does anyone uses qt with haskell at all, or is gtk2hs the current favorite ?
QtHaskell supports Qt 4.6 and thus QtQuick, at least the early lighthouse build version. Note that this version of QtQuick is completely different from the current QtQuick version; most elements and properties have completely different names.
GTK support for Haskell is being actively maintained. As you have seen for yourself, the same cannot be said about Qt. One of the main reasons is that GHC cannot import foreign C++ code by itself; you need to generate wrapper C code that is then called by GHC, and there isn't a general method for wrapping C++ code as C, so a new tool has to be developed for C++ in this case. So, the "current favorites" for GUI libraries in Haskell are GTK and WxWidgets.
It would be very interesting to use Qt in Haskell, for example because the Qt sockets system could be used to link into FRP (functional reactive programming) libraries, and because Qt has an interface that is very referentially transparent and that supports immutable data structures.
There is actually a library to use Qt Quick from Haskell, though I didn't (yet) try it myself:
http://hackage.haskell.org/package/hsqml-0.1.1
http://www.gekkou.co.uk/software/hsqml/
http://www.haskell.org/pipermail/haskell-cafe/2012-September/103350.html
It is maintained as of now, with the latest release being in september 2012. There is also a demo program published on hackage.
That version doesn't yet support emitting Qt signals from Haskell code, there is however a fork which is supposed to offer that feature:
https://github.com/travitch/hsqml
But the fork appears less maintained than the original package, and in addition the author of the original package stated that he intends to add that feature in the future (and also support Qt5 when it will be available).
UPDATE now happily using this library, although it didn't get much traction, it works great for me.
I'm toying with the idea of writing a command line interpreter and I suspect that a functional language such as Clojure is well suited to this task.
I am however 5 years out of a CS degree and my only experience with functional languages was a harrowing experience with Haskell in a third year languages course.
So, is a language such as Clojure ideal for this task? If not, what is an ideal language.
Loose requirements:
Has to run on a JVM
Provide an interactive shell where users enter commands with a CLI like syntax
User commands ultimately end up making calls to a remote service using SOAP.
Thanks!
You can approximately do that out-of-the-box with Clojure and Scala, and with Java if you add BeanShell. You might look at the REPL facilities they already have.
I imagine that's suited only for sophisticated users. But really, it's hard to imagine a language that wouldn't do a fine job on a CLI.
Deciding between platforms, the more of a modern system it is, the more it will have scripting language convenience.
I certainly know what I would use given your requirements: JRuby. (It has an out-of-the-box REPL, too.)
I don't think a CLI has any specific requirements language-wise; you could probably do just as well writing it in Java or Scala. Ultimately I think language choice is down to:
Which ones you are most comfortable working with.
Which ones have adequate library support for what you want to do (i.e. web services).