Swift for Windows and creating GUI - swift

I tried to find some answers but cannot really find anything useful. Is there possibility to create a GUI using Swift under Windows?
I do not expect a real interoperability between MacOS and Windows GUI but I can't even find any documentation about creating GUI under Windows.

The best thing I could find in the past months was Silver, a commercial Swift implementation/fork:
With Silver, you can use Swift to write code directly against the .NET, Java, Android and Cocoa APIs. And you can also share a lot of non-UI code between platforms.
Developing Windows applications seems to be free, but the next option costs $799 already.
So you could say Silver is a Swift fork with some extras.
Swift updates and Silver updates aren't exactly in lock-step with one another, so you have to wait for the maintainers to update the language to be truly source compatible.
Silver extends the language with stuff familiar to Java/C# people.
See other limitations.
It seems Silver isn't even 1.0, yet.
I cannot add personal experience; I'm torn at the moment. It looks cool but I don't know how productive you can be, writing code in the latest Swift to compose your types and then hitting language road bumps in Silver. I guess that's why there's a Silver Cocoa bridge: because you'll be writing Silver code, not Swift code, although both are pretty similar.

There are some GUI examples in 'Swift for Windows' project at http://SwiftForWindows.github.io but the GUI toolkit is alpha version.

Related

Application based on Gstreamer + Gtk+3 on ubuntu 18.04

What is the good and efficient language to develop a video streaming application using Gstreamer + gtk+ ??
The application which we developed has to do things notify the user whenever the some uneven behaviour occured where we are looking into...
Any suggestions will be useful.....
Thanks in advancešŸ˜Š
Of course depends on your liking and what else you need and want to do in the application. Since you are Gtk and Linux I would recommend to look at Vala:
https://wiki.gnome.org/Projects/Vala
I made a proof of concept app with that at some time to watch Twitch.tv streams:
https://github.com/fzwoch/twit-twat
Maybe take a look if you are fine with the ease and look of the language for your purpose.
No troll intended, but Vala looks like a dead end for most people I talk to. It's a specific language that never caught outside of GNOME, and I'm not sure it has the brightest future.
Rust seems to get wider adoption but seems still at an early age, still usable though, even for GStreamer use.
Python is both adopted, simple, and has stable bindings.
If you prefer a compiled language, C++ and GTKmm would be a possibility too, but at this point, depending on your requirements, and assuming you're not afraid of the moving ecosystem, Rust might still be a better choice.

Should I use jMonkeyEngine 3 (jME 3) or Unity 4.3 to teach game programming to my children? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm looking to teach my kids programming, and it looks like I've narrowed it to two options:
jMonkeyEngine 3 (jME 3)
Unity 4.3
I couldn't find any "current" comparisons, and so I thought I'd ask:
Which is better jME3+ or Unity4.3+ for Teaching Programming vs Engine Benefits?
I'm not a game developer, but as a corporate & control systems developer I have experience in both C# and Java.
I'm currently leaning towards Unity4.3+ because:
From a Programming perspective, I think C# is a little cleaner than Java, though this means little if the Engine Coding & Object model encourage poor programming
Engine Benefits: Unity4.3+ will "supposedly" have upcoming support for both XBox One & PS4
Note: in fairness to jME, I will make note of this "pre-alpha state" iOS option for jME which is better than a marketing "supposed" perhaps: (http://hub.jmonkeyengine.org/wiki/doku.php/jme3:ios)
If they are equal in all other regards, which one has better Service integration?
Glad that you interesting in JME3.
Iā€™m also working for a project that target making education programs (youngs and adults) in gaming enviroment.
If you going to let your children learn programming via game developing, itā€™s a good idea. But both JME3 and Unity are far more complicated to start with ( I assume your children are still young )ā€¦ There are also few projects suitable for children to learn programming visually.
Greenfoot ww.java.com/en/java_in_action/alice.jsp
Alice ww.greenfoot.org/door
Kojo ww.kogics.net/sf:kojo
Those things (languages come with IDEs) have short learning curve and easy to get with, require minimum knowledge and suitable for children and starter. Thatā€™s the education side.
For the engine side. [This is my personal opinion]
I prefered JME.
Iā€™m also left Unity ( did about 4-5 commercial games in unity my self) to go to JME. Before Unity, i also worked in Ogre, UDK, Torque and a lot other engines ( 10 more). I also worked with commercial engine in daytime job in C++, which code dirty as hell but run extremely smooth and cost millions dollar.
The reason is: Those engine tied you up with its limitation and pre-made sollutions. Of course thatā€™s also half of the reason why you choose and engine at first. But when you hit that limitation, for example the license fee or the closed technologies. You will hate them as much as i did.
So thatā€™s why i come to JME in a search of ā€œcompleteā€ game developing and entertaining technology.
If you are an experienced Java and C#, in association with JME and Unity developer, i will name you a few things that can be *strong text*compared between the two:
License : free open source vs free / commercial
IDEs : Netbean ā€“ an open and extensible platform ( leading quality) vs MonoEdit (the most buggy IDE you can find on earth)
** The based technolgy:**
Graphics: OpenGL v2+ vs Modified renderer ( openGL compatiable v3+) Unity win in this one i suppose :( . Itā€™s sad for a long term java developer like me seeing this. But we can improve the graphics from time to time i hope.
Data management: You choose ( H2, HyperTable, Neo4j ā€¦from Java world 100+ of those) VS Unity database
Data oganization: You choose (ES, OO, COD, data driven ā€¦) VS ES and data driven only.
Networks: You choose ( Java rocks in this one) VS Unity network ( high performance but neverā€¦ ever defeat Java)
Cloud and distributed: You choose (Storm, Hadoop..) VS home grown "cloud techsā€
Note that i still usually using Unity and JME3 at the same time, for my job and for my hobby. I used Unity 4 with fancy mecanim animation, sub stance material ā€¦ at day, and using JME3 for research and improve it at night. IMO, JME3 is the game engine which worth to learn, and it will rocks and shine in the future!!!
Hope this help!
It's hard to make a comparison when I have never actually used Unity. I have seen demo's and it's interface however. But having used the jMonkeyengine for about 2 and a half years, I can say I am a happy customer :).
Unity probably has a bit more of everything: developers, users, bells and whistles, but there is a cost associated to that.
Similarities between the 2:
- Big communities (Unity is bigger)
- Many free tutorials
- Rapid development (here's a link to a couple ludum dares I've been involved with using jME http://www.ludumdare.com/compo/ludum-dare-28/comment-page-3/?action=preview&uid=16152, http://www.ludumdare.com/compo/ludum-dare-24/comment-page-1/?action=preview&uid=16152)
- Easy to distribute to Windows/Mac/Linux/Android
The jMonkeyEngine is completely free and all open source (New BSD License). So you can see all the inner workings of the engine, and even change it if you do not like something (of course you are welcome to commit the changes back :)). So you will learn a lot more by delving into the jME source code.
C# and Java is a debate that can go on for ages, but I don't think it should be a defining factor, they are very similar in nature. There doesn't exist a usable iOS version in jME, and I don't think there is any immediate plans for Xbox One and PS4, so Unity will win there.
JME is a bit more hardcore engine than Unity.
JME:
- strong community (english language mostly)
- OpenSource and free to use.
- has many cool tools. But Unity has much more i guess.
- Simple to compile and code with all platforms.
- Supports Linux. You can develop games in Linux OS.
Unity:
- Strong community (with many local communities and languages)
- Non free. But it has professional tools.
- Has javascript support. You can add scripts inside of the editor.
- Has really cool world editor. But coding is better in JME SDK.
I use JME. But it's hardcore in many cases.
It really depends on what you aim for.
The pro on unity is especially way to get assets into the engine (via the shop).
With jme3 you need to be able to at least partly work with blender/3dsmax or similar. Or use a graphic style where it does not matter (eg 2d or blockworld)
Also it has better state of the art features in terms of lighting and shadowing.
But you kinda need to pro license sooner or later, as even basic stuff as lod is tied to it
http://unity3d.com/unity/licenses and it is not that cheap.
The pro with jme3 is that it does not limit you. It is only a core engine but also not tailored for some use-cases.
As far as I understand Unity uses a kinda Entity-component system but without separate systems. (The components contain the logic)
In jme3 you are free to use whatever you want, and are encouraged to make a clean split between logic and graphic. You are free to use whatever programming type you prefer (eg ES,OO) As jme is jvm based you also have access to other jvm languages, eg for functional programming via scala.
So it depends on what your target(and budget) is, more about developing and their specifics, or more about making a own game.
Regarding the version controll,
JME3 works fine with git and svn and kind everything else. As there are no special files or logic tied to any of them.
I can't say I've ever used Unity but here are some things I love about JME3:
Completely free & open-source under BSD license
Awesome SDK based on awesome NetBeans
Deployment to Linux, Mac & Android (as well as windows) with 1 click, I have no idea if Unity can do this
Amazing active community, constantly creating new plugins and features (IOS deployment coming soon, possibly), they will also help you with any trouble you run into
Networking is awesome
Can use other Java libraries or features alongside
As far as features of the engine go, Unity probably has more. However, I highly recommend JME, it is a great engine. Somebody else said you need knowledge of blender, whereas with Unity they have an asset shop. While Blender knowledge is (very) useful, there are hundreds of websites online that sell or give away for free assets (for instance www.turbosquid.com).
I have to ask, is whomever you're teaching actually ready to program for a game engine?
If the first thing that has to be taught is a hello world script followed by learning what variables are, then both options do nothing but over-complicate what needs to be a simple learning environment.
Even if they have the basics of programming down, they should know what the basics of game programming are. They should know what a vector is and how matrix math works with some underlying understanding of how an engine operates.
I don't know about jME, but with Unity, this would be the point where they could actually write code that does something in which they can earnestly say they understand why (which should be the most important part of teaching someone). I describe Unity as the simplest, big boy toy out there. That still means they have to be ready for the big boy toys in the first place.
Oh, and stick with the free version of Unity. Most pro features are graphical elements like bloom lighting that don't effect a programmer's capabilities.

Has Anyone Successfully Used CMU Sphinx for Programming by Voice Recognition

I want to start doing some of my coding by voice recognition software (maybe 10-20% of the work I do).
I've seen that some people have had success with Dragon Natural Speaking (DNS) software, but I use a Mac, and unfortunately, Dragon only works on Windows.
Has anyone used the Carnegie Melon open source Sphinx http://cmusphinx.sourceforge.net/ for programming?
Are there other options that I could implement on a Mac? I don't mind dropping a little bit of cash to make this a reality. Ideally it would be a system where I could add in my own commands. (Check out the awesome stuff this guy did, with DNS: https://www.youtube.com/watch?v=8SkdfdXWYaI)
There is a protoype plugin for IDEA written by JetBrains developers. The work was done during one of their hackathons.
If you are not fixed with Sphinx, I would recommend Kaldi as an adaptable, compatible open-source speech recognizer. With kaldi you can adapt your own grammar and commands and retrain the underlying models. In addition, there is a python-wrapper that makes Kaldis use easy and convenient.

Is there a cross-platform framework for C?

I am curious to know if there is any kind of programming library/framework for the C language for cross-platform programming of course. I mean there are already frameworks like Wxwidgets, Boost, Qt, U++ and etc for C++ available but I have not yet found any for C .
Updated Info:
We are trying to build an underlying Framework/library to be used in our project. We are going to eliminate the dotnet and instead provide a counterpart for those libraries which is fast and less demanding.
We will be working on a server/client based project, and thus the underlying services must be fast and also portable. GUI is not our priority now, but libraries providing threading capabilities is of importance to us.
And for the ANSI part, I think we are fine with that at the moment unless something changes that in the future.
if you write plain ANSI C, it should work on every POSIX system.
The most successful example of cross platform C library is standard C library itself (IMHO).
If you're looking for GUI toolkit GTK is the answer,
if you're looking for terminal UI, ncurses is pretty portable.
If you're looking for general use libraries, as long as they're written in ANSI C, should work almost everywhere, as long as it doesn't use system level APIs.
Can you just tell us, what kind of library/framework you are looking for ?
GTK+ is long established and actively maintained cross-platform C-only (or primarily) toolkit. You'll find not only on-line documentation but also books written about it. It is the framework backing up the GNOME project.
GTK+ is meant to build applications with UI, first of all. However, even if you don't need UI you'll find that some GTK+ components, namely GLib, provide general multiplatform support comparable with Qt. Actually, I needed a framework without UI at first and chose GLib over APR because I was able to find documentation and tutorials easier.
GTK+ was initially developed on UN*X an X-Windows which remains the platform where you can get it running the most easily. I wouldn't say that it is more difficult on Windows; it is just that you have more compiling environment options. I started with prepared GTK+ packages and MinGW but ended up integrating GTK+ with MSVC.
GTK+ exists for a long time and some people may find it old-school. On the other hand, it shows that it has proven to be stable and useful. There are also bindings for C++ and C#.
As with every big framework, the more you need from it the longer you will have to learn. But the other way round it works too; the more you learn the more you'll be able to do with it. Consistent coding style helps getting used to it.
--- Ferda

How to code sharing between Android and iOS

I'm moving away from strict Android development and wanting to create iPhone applications. My understanding is that I can code the backend of iOS applications in C/C++ and also that I can use the NDK to include C/C++ code in Android apps. My question however is how? I've googled quite a bit and I can't find any clear and concise answers.
When looking at sample code for the NDK, it seems that all the function names etc. are Android (or at least Java) specific and so I would not be able to use this C/C++ backend to develop an iPhone frontend?
I'd appreciate some clarification on this issue and if at all available some code to help me out? (even just a simple Hello World that reads a string from a C/C++ file and displays it in an iOS and Android app).
Thanks guys
Chris
Note that I almost exclusively work on "business/utility/productivity" applications; things that rely heavily on fairly standard UI elements and expect to integrate well with their platform. This answer reflects that. See Mitch Lindgren's comment to Shaggy Frog's answer for good comments for game developers, who have a completely different situation.
I believe #Shaggy Frog is incorrect here. If you have effective, tested code in C++, there is no reason not to share it between Android and iPhone, and I've worked on projects that do just that and it can be very successful. There are dangers that should be avoided, however.
Most critically, be careful of "lowest common denominator." Self-contained, algorithmic code, shares very well. Complex frameworks that manage threads, talk on the network, or otherwise interact with the OS are more challenging to do in a way that doesn't force you to break the paradigms of the platform and shoot for the LCD that works equally badly on all platforms. In particular, I recommend writing your networking code using the platform's frameworks. This often requires a "sandwich" approach where the top layer is platform-specific and the very bottom layer is platform-specific, and the middle is portable. This is a very good thing if designed carefully.
Thread management and timers should also be done using the platform's frameworks. In particular, Java uses threads heavily, while iOS typically relies on its runloop to avoid threads. When iOS does use threads, GCD is strongly preferred. Again, the solution here is to isolate the truly portable algorithms, and let platform-specific code manage how it gets called.
If you have a complex, existing framework that is heavily threaded and has a lot of network or UI code spread throughout it, then sharing it may be difficult, but my recommendation still would be to look for ways to refactor it rather than rewrite it.
As an iOS and Mac developer who works extensively with cross-platform code shared on Linux, Windows and Android, I can say that Android is by far the most annoying of the platforms to share with (Windows used to hold this distinction, but Android blew it away). Android has had the most cases where it is not wise to share code. But there are still many opportunities for code reuse and they should be pursued.
While the sentiment is sound (you are following the policy of Don't Repeat Yourself), it's only pragmatic if what you can share that code in an efficient manner. In this case, it's not really possible to have a "write once" approach to cross-platform development where the code for two platforms needs to be written in different languages (C/C++/Obj-C on iPhone, Java for Android).
You'll be better off writing two different codebases in this case (in two different languages). Word of advice: don't write your Java code like it's C++, or your C++ code like it's Java. I worked at a company a number of years ago who had a product they "ported" from Java to C++, and they didn't write the C++ code like it was C++, and it caused all sorts of problems, not to mention being hard to read.
Writing a shared code base is really practical in this situation. There is some overhead to setting up and keeping it organized, but the major benefits are these 1) reduce the amount of code by sharing common functionality 2) Sharing bug fixes to the common code base. I'm currently aware of two routes that I'm considering for a project - use the native c/c++ (gains in speed at the expense of losing garbage collection and setting targets per processor) or use monodroid/monotouch which provide c# bindings for each os's platform functionality (I'm uncertain of how mature this is.)
If I was writing a game using 3d I'd definitely use approach #1.
I posted this same answer to a similar question but I think it's relevant so...
I use BatteryTech for my platform-abstraction stuff and my project structure looks like this:
On my PC:
gamename - contains just the common code
gamename-android - holds mostly BatteryTech's android-specific code and Android config, builders point to gamename project for common code
gamename-win32 - Just for building out to Windows, uses code from gamename project
On my Mac:
gamename - contains just the common code
gamename-ios - The iPhone/iPad build, imports common code
gamename-osx - The OSX native build. imports common code.
And I use SVN to share between my PC and Mac. My only real problems are when I add classes to the common codebase in Windows and then update on the mac to pull them down from SVN. XCode doesn't have a way to automatically add them to the project without scripts, so I have to pull them in manually each time, which is a pain but isn't the end of the world.
All of this stuff comes with BatteryTech so it's easy to figure out once you get it.
Besides using C/C++ share so lib.
If to develop cross-platform apps like game, suggest use mono-based framework like Unity3D.
Else if to develop business apps which require native UI and want to share business logic code cross mobile platforms, I suggest use Lua embedded engine as client business logic center.
The client UI is still native and get best UI performance. i.e Java on Android and ObjectC on iOS etc.
The logic is shared with same Lua scripts for all platform.
So the Lua layer is similar as client services (compare to server side services).
-- Anderson Mao, 2013-03-28
Though I don't use these myself as most of the stuff I write won't port well, I would recommend using something like Appcelerator or Red Foundry to build basic applications that can then be created natively on either platform. In these cases, you're not writing objective-c or java, you use some kind of intermediary. Note that if you move outside the box they've confined you to, you'll need to write your own code closer to the metal.