Builing modules with other, non-Java JVM languages

Post Reply
User avatar
nekomatic
Posts: 64
Joined: Mon Jul 08, 2019 8:52 pm

Builing modules with other, non-Java JVM languages

Post by nekomatic »

Has anybody actually tried building a module for VM using a language different than Java? Or at least tried to add an external library (like i.e. stdlib of the language). I'm interested to see if you had any situation when an extra jar added to the VMD upsets the Voltage Modular in any way... I.e. I tried building some stuff in Kotlin - everything works fine in VMD but it seems VM does not like if there are too many classes used in the module (i.e. kotlin's stdlib ).

A concrete example - I have initally built the Almanacs Granular Processor entirely in Kotlin and it was tested in this form also in terms of performance which was very good even on my very old PC - One annoing VM issue we encoumtered was when we tried to add this module to an empty cabinet right after the VM started, VM UI got frozen for couple of seconds, from my observations it did seem like VM cannot efficiently handle modules whith larger number of classes - in comparison the startup time of the same code outside VM had to be measured in milliseconds - I have rewritten this module in pure java from scratch so its not affected anymore but it seems using any off-the-shelf library will most likely cause such UI freeze.

I have obvioulsy notified support about this but they seem rather busy these days fine-tuning all the other performance issues so in the meantime I took the chance to find out if anybody else on this forum had similar experience - or maybe it's just me?
ichiohta
Posts: 1
Joined: Mon Jun 13, 2022 4:40 am

Re: Builing modules with other, non-Java JVM languages

Post by ichiohta »

I'm writing modules in Kotlin. The UI surface is still have to be written in Java but I could write most of the DSP code in Kotlin.
Have to include Kotlin runtime in a module binary, and it makes the module size bigger, but it works. I wish if Voltage Modular runtime include Kotlin runtime too.
UrbanCyborg
Posts: 625
Joined: Mon Nov 15, 2021 9:23 pm

Re: Builing modules with other, non-Java JVM languages

Post by UrbanCyborg »

Just out of curiosity, have you tried including only the required elements of the standard library (assuming that's possible; I'm not familiar with that language).
Cyberwerks Heavy Industries -- viewforum.php?f=76
boingy
Posts: 11
Joined: Sun Jun 05, 2022 12:21 pm

Re: Builing modules with other, non-Java JVM languages

Post by boingy »

ichiohta wrote: Mon Jun 13, 2022 4:45 am I'm writing modules in Kotlin. The UI surface is still have to be written in Java but I could write most of the DSP code in Kotlin.
Have to include Kotlin runtime in a module binary, and it makes the module size bigger, but it works. I wish if Voltage Modular runtime include Kotlin runtime too.
Can I ask why you use Kotlin? It's not one I've heard of before. What are the advantages for VM stuff?
ColinP
Posts: 1000
Joined: Mon Aug 03, 2020 7:46 pm

Re: Builing modules with other, non-Java JVM languages

Post by ColinP »

I only discovered Kotlin recently. It has some nice modern features but doesn't seem to offer anything that would make me want to switch to it from Java. It's supposed to be an easy transition from Java but the syntax is quite different so I don't think that claim stands up.

Even though Java and Kotlin will happily coexist I wouldn't want to do the mental gymnastics involved in moving between the two in a project that involved both.

Also I like very strict typing (or at the opposite extreme duck typing) so am unsure about type inference. Also at least superficially some Kotlin features look like solutions looking for problems. This reminds me of when Eiffel went from V2 to V3 in order to solve problems that 99.9% of the time you wouldn't encounter. Simplicity is underrated in language design.

When I was younger I used to switch languages about once a year and designed and implemented many languages myself but I'm in my sixties now and am happy enough to stick with Java. It's an idiom I can work in at high speed because I don't need to think too much (although I am still learning all the time). But essentially it's a bit like mountain biking - if you think about what you're doing you'll crash.

I've also come to realise that programming is really not the hardest part of developing. Designing new stuff is the real challenge.

Rather than Kotlin what would be very useful would be a high efficiency language with a familiar syntax that was easier for beginners to learn than things like C++, Java or Kotlin.

Having said all that, if I was in my twenties I would probably be raving about how brilliant Kotlin was.
Post Reply

Return to “Module Designer”