# Can the two language problem ever be solved for GUI programming

**URL:** <https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857>\
**Category:** Offtopic\
**Tags:** guis, gui\
**Created:** [February 6, 2018, 5:34am UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857 "2018-02-06T05:34:25Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![Steven\_Sagaert](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steven_sagaert/32/29578_2.png) [@Steven\_Sagaert](https://discourse.julialang.org/u/Steven_Sagaert)\
**Post date:** [February 20, 2018, 11:29am UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/41 "2018-02-20T11:29:32Z")

</div>

You’re welcome 🙂

---

<div class="post-metadata">

**Author:** ![asampal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asampal/32/253_2.png) [@asampal](https://discourse.julialang.org/u/asampal)\
**Post date:** [February 20, 2018, 4:26pm UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/42 "2018-02-20T16:26:48Z")

</div>

WRT UIs, I think people are possibly missing the elephant in the room, namely AR/VR. IMO (based on having/using a VR system), I don’t think I’m going out on a limb predicting that _all_ UIs will be AR/VR-based in the not too distant future. In particular, data manipulation/visualization will be one of the first areas to move in that direction due to the significant benefits of working in that kind of environment. If you doubt this, I urge you to check out VR (not the, currently, lame cellphone type, though) - you’ll most likely be converted. Sure, today’s hardware isn’t quite there in terms of comfort/resolution, but we’re not very far off.

If you buy into the above, performance, compatibility with AR/VR rendering and AR/VR HCI considerations should be a key factors when thinking about UIs which won’t soon become irrelevant.

---

<div class="post-metadata">

**Author:** ![jebej](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jebej/32/1784_2.png) [@jebej](https://discourse.julialang.org/u/jebej)\
**Post date:** [February 20, 2018, 4:45pm UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/43 "2018-02-20T16:45:24Z")

</div>

Hopefully web stuff will quickly move toward WebAssembly, because the performance of Electron apps is quite bad right now… We can’t even have [spinning cogs](https://github.com/JunoLab/atom-ink/issues/142) in Atom!

---

<div class="post-metadata">

**Author:** ![Steven\_Sagaert](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steven_sagaert/32/29578_2.png) [@Steven\_Sagaert](https://discourse.julialang.org/u/Steven_Sagaert)\
**Post date:** [February 20, 2018, 4:58pm UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/44 "2018-02-20T16:58:47Z")

</div>

You can get quite decent performance for 3D or plotting a lot of 2D points via webgl. Maybe not for very high density 3D medical scans or scientific visualizations but for that you would use something like VTK on a high graphics workstation.

---

<div class="post-metadata">

**Author:** ![asampal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asampal/32/253_2.png) [@asampal](https://discourse.julialang.org/u/asampal)\
**Post date:** [February 20, 2018, 5:09pm UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/45 "2018-02-20T17:09:21Z")

</div>

> [@Steven\_Sagaert](#):
>
> You can get quite decent performance for 3D or plotting a lot of 2D points via webgl.

My impression of WebVR (which uses WebGL) is that there’s a very significant performance drop with that vs running VR out of the browser, so, while you might consider it adequate for some things, I’m not sure I’d want to use it given a choice. So far, when it comes to glitch-free (no pause animation, instant updating, etc) UIs, I can’t say that the browser platform has been very impressive. I’d say that it’s great to be able to use a current-gen browser while in AR/VR, but I would want as much of the AR/VR specific UI to be implemented outside of that.

---

<div class="post-metadata">

**Author:** ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Post date:** [February 20, 2018, 8:40pm UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/46 "2018-02-20T20:40:18Z")

</div>

These “web GUI / Visualization has good enough speed” arguments sound exactly like the arguments in favour of using Python for scientific computing…

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [February 20, 2018, 9:25pm UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/47 "2018-02-20T21:25:32Z")

</div>

Agreed. Until Julia came along, it was “common knowledge” that you couldn’t solve the two language problem for technical computing. While it seems like the problems for graphics are somewhat different from those for numerical work (although there’s a fair amount of overlap), and at this point less work on Julia has been towards things like minimizing the time to first plot, in general the problems in graphics seem surmountable and overall easier than problems those that have already addressed. In short, it doesn’t seem like there’s any fundamental reason why Julia couldn’t solve the two language problem in graphics with some more time and effort.

---

<div class="post-metadata">

**Author:** ![Steven\_Sagaert](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steven_sagaert/32/29578_2.png) [@Steven\_Sagaert](https://discourse.julialang.org/u/Steven_Sagaert)\
**Post date:** [February 20, 2018, 9:44pm UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/48 "2018-02-20T21:44:35Z")

</div>

No. Firstly: visualization & computation are 2 different things. Secondly: if you read my post about webassembly and understood it you would see that I envision a future where it’s all julia (with possibly some html as a GUI DSL): julia on the server doing the backend number crunching and julia (compiled to webassembly or at least a julia runtime in webassembly) running in the browser for the GUI & interactivity & visualizations. So one language (and one compilation target= webassembly) to rule them all. No 2 language problem. Webassembly is native code (kind of) so nothing like Python (and BTW all the heavy lifting in Python is done in native code (C/C++/Fortran) and gives good performance (OK maybe not C or fortran but close enough for GUI & viz).

My comment about good enough speed was about WebGL (which is also kind of native and much more performant compared to the other web vector graphics tech: SVG). WebGL is certainly good enough for showing a 3D model and rotating it interactively without a hitch (see for example 3D plots on the plotly site). Maybe not for a hi res VR simulation at 50 FPS but that’s a very specific niche and I don’ t see that coming anytime so to browsers or even mainstream. I’ve seen the VR hype more than 20 years ago. Didn’t go anywhere and it seems the same VR hype we had a couple years ago is dead already again. So what 's the problem with standard scientific plotting in the browser? Nothing at all. Totally doable and in fact it has been done: See D3.js, plotly.js and that’s (mostly) in javascript. Probably could be faster when webassembly analogs appear.

---

<div class="post-metadata">

**Author:** ![asampal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asampal/32/253_2.png) [@asampal](https://discourse.julialang.org/u/asampal)\
**Post date:** [February 20, 2018, 10:28pm UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/49 "2018-02-20T22:28:02Z")

</div>

> [@Steven\_Sagaert](#):
>
> VR hype more than 20 years ago

Uh, VR of 20 years ago is not today’s VR. Like I said, try it out. Minimum spec for the better HMDs is about 90 Hz with displays soon to be 4K resolution per eye - so two different buffers at 90 Hz. That’s a lot of graphics needing to be shuffled around.

Take a fluid simulation “experience” like Chroma Lab, [Chroma Lab on Steam](http://store.steampowered.com/app/587470/Chroma_Lab). With my i7 6700K, 16 GB RAM, and 1080 GTX I can simulate about 800,000-1,000,000 particles with good response. Going higher, things start to slow down.

Another demo of a force-directed graph, [DevUp: Force-Directed Graph in VR | by Zach Kinstner | Medium](https://medium.com/@zachkinstner/devup-force-directed-graph-in-vr-9e6bf3e1a351), shows off really nicely what you could expect with a VR UI. I’d like to see it being able to handle millions of nodes.

As far as VR being a hype tech like 3D on TVs, I think you’re getting bad info. Once AR/VR glasses/HMDs become a bit more comfortable (and wireless) soon, you’ll see adoption soar, especially for commercial use. You will not be able to compete at your job with with people that choose to use AR/VR instead of limiting themselves to a 2D world and traditional HCI. Remember, in AR/VR you can have the 2D _and_ a lot more.

---

<div class="post-metadata">

**Author:** ![John\_Hearns](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/john_hearns/32/1685_2.png) [@John\_Hearns](https://discourse.julialang.org/u/John_Hearns)\
**Post date:** [February 21, 2018, 1:53pm UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/50 "2018-02-21T13:53:22Z")

</div>

@asmpal I agree. Look at the current Microsoft standard for mixed reality headsets. Several manufacturers make them - hP, Dell, Asus. They do not need a room set up with sensors, just the headset plus two controllers. Fro Windows users, there is an app which tests if your system meets the minumum specifications. My HP Spectre laptop meets them - just. That’s why I bought it. OR you coudl have a higher end ‘gaming’ laptop.  
Just think - you can carry around a VR system in a laptop bag. (HP actually have a backpack mounted VR setup, which basically means carrying a PC on your back… hmmm)

I agree there will eb a big takeup of VR for visualisation and design work using these portable setups.

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [February 21, 2018, 3:56pm UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/51 "2018-02-21T15:56:19Z")

</div>

> [@John\_Hearns](#):
>
> (HP actually have a backpack mounted VR setup, which basically means carrying a PC on your back… hmmm)

That’s me, whenever I leave the house - always have my laptop with me on my back!  
🤓

---

<div class="post-metadata">

**Author:** ![John\_Hearns](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/john_hearns/32/1685_2.png) [@John\_Hearns](https://discourse.julialang.org/u/John_Hearns)\
**Post date:** [February 21, 2018, 4:15pm UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/52 "2018-02-21T16:15:41Z")

</div>

This is the HP backpack  
[http://www8.hp.com/us/en/campaigns/vrbackpack/overview.html](http://www8.hp.com/us/en/campaigns/vrbackpack/overview.html)  
I see it having applications, but only in training or simulation facilities which have big budgets.

You could build a functional VR rig using a laptop with a Thunderbolt output plus an e-GPU enclosure (a thunderbolt cabled enclosure with a more powerful GPU)

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [February 21, 2018, 4:39pm UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/53 "2018-02-21T16:39:41Z")

</div>

That’s pretty damn cool!

---

<div class="post-metadata">

**Author:** ![asampal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asampal/32/253_2.png) [@asampal](https://discourse.julialang.org/u/asampal)\
**Post date:** [February 21, 2018, 8:46pm UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/54 "2018-02-21T20:46:52Z")

</div>

There are a few of these backpack type units, but IMO they’ll be redundant soon if they’re not already. Wireless modules like [TPCast](https://www.tpcastvr.com/) (available now for the Vive and soon for Oculus), but also from Intel and others which will be out later this year make tethering to the system unnecessary.

---

<div class="post-metadata">

**Author:** ![apieum](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/apieum/32/2928_2.png) [@apieum](https://discourse.julialang.org/u/apieum)\
**Post date:** [February 21, 2018, 10:34pm UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/55 "2018-02-21T22:34:07Z")

</div>

While reading “game developer”, “Gui framework”, “AR/VR” on a topic containing “two language problem”… I can’t resists to ask if you know Godot game engine (under MIT) ? if adding julia as scripting language for godot is doable (due to inheritance) and may be worth the effort of implementing it.

---

<div class="post-metadata">

**Author:** ![piever](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/piever/32/1815_2.png) [@piever](https://discourse.julialang.org/u/piever)\
**Post date:** [February 22, 2018, 9:41am UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/56 "2018-02-22T09:41:36Z")

</div>

I’ve been developing a game with Godot and indeed it has good support for UI design. Their own scripting language (GDScript) is quite good, but I understand that it’d be interesting to see if one could call Julia from Godot. Godot has bindings with a few other languages using a thing called [GDNative](https://godotengine.org/article/look-gdnative-architecture): see [here](https://github.com/GodotNativeTools) for a few examples: D, C++, Rust, etc… Not sure what it’d take to have Julia bindings.

---

<div class="post-metadata">

**Author:** ![apieum](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/apieum/32/2928_2.png) [@apieum](https://discourse.julialang.org/u/apieum)\
**Post date:** [February 22, 2018, 11:22am UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/57 "2018-02-22T11:22:25Z")

</div>

It may also be possible to develop a julia module like the C# one or GDScript one: [https://github.com/godotengine/godot/tree/master/modules](https://github.com/godotengine/godot/tree/master/modules)

This way you develop something in julia without UI and the day you want to have an UI you can do it with importing your libs inside godot and develop it with the tools it provides.

As a game engine performance is important, so you avoid pitfalls of html…

@piever with your knowledge of godot, do you see blockers due to the strong object oriented facets of it (nodes, inheritance) ?

---

<div class="post-metadata">

**Author:** ![piever](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/piever/32/1815_2.png) [@piever](https://discourse.julialang.org/u/piever)\
**Post date:** [February 22, 2018, 11:58am UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/58 "2018-02-22T11:58:33Z")

</div>

I’m just messing around with Godot, I’m not an expert on the implementation. In terms of inheritance, one could try to use abstract types, say:

```julia
abstract type Node; end
struct Sprite <: Node
    image
   ....
end

```

Though it may be limiting that you can only define one supertype for your `struct`

From what I understand the design is more “encapsulation” than inheritance based (at least as far as the nodes are concerned). So, you would basically add the node you want to use function from in the parent node.

```julia
struct Player
    ship
    bullets
    lifebar
end

```

end then use methods on `p.ship`. With [dot field overloading](https://github.com/JuliaLang/julia/issues/1974) maybe you could get somewhere, I don’t actually know.

---

<div class="post-metadata">

**Author:** ![apieum](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/apieum/32/2928_2.png) [@apieum](https://discourse.julialang.org/u/apieum)\
**Post date:** [February 22, 2018, 5:18pm UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/59 "2018-02-22T17:18:15Z")

</div>

Thank you 😄

---

<div class="post-metadata">

**Author:** ![Steven\_Sagaert](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steven_sagaert/32/29578_2.png) [@Steven\_Sagaert](https://discourse.julialang.org/u/Steven_Sagaert)\
**Post date:** [March 9, 2018, 11:22pm UTC](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857/60 "2018-03-09T23:22:51Z")

</div>

FYI here’s a demo video of a 3D game running in the browser on webassembly +webgl [EpicZenGarden, WebAssembly and WebGL 2 in Firefox 52 - YouTube](https://www.youtube.com/watch?v=-QOAtQSTyXw)

Looks pretty smooth to me!

[Previous page](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857.md?page=2)

[Next page](https://discourse.julialang.org/t/can-the-two-language-problem-ever-be-solved-for-gui-programming/8857.md?page=4)
