Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

At my university, I have a yearly essay. I'm allowed to use any technology for implementing it. I've been coding it in C++ with Qt. I thought of about Wolfram Mathematica because I have some experience in it.

I need such functionality:

  • Timers — for calling functions by timer
  • Threads (or Processes are good too)
  • User-friendly GUI (buttons, input forms)
  • Be able to catch when user clicked left/right mouse buttons or key on keyboard
  • Dynamic graphics (with changing graphics in time)
  • Launching applications as a standalone executable file

I'm ready to put more effort into it. But I wonder whether I'm burying myself alive trying to implement things which Mathematica isn't devoted to do.

I would appreciate links to topics marked with questions signs.

How bad is this idea? What are your opinions? Should I do it in C++? (Doing it in Mathematica would be challenging for me.)

enter image description here

share|improve this question
4  
why downvote? Pls, downvote me, but give explanations why –  E6aTb_E6aTb Nov 27 '13 at 19:30
3  
I see this as a question along the lines "Does Mathematica have these listed capabilities, or something fairly close?" Strikes me as a perfectly reasonable query. Re Threads, there is support for parallelism but not sure what might be needed. I think the rest is all available, albeit the "launch as stand-alone" would require at least CDF Player on the receiving end. If I understand correctly what's wanted, which I may well have wrong. –  Daniel Lichtblau Nov 27 '13 at 20:11
3  
You are doing a school project that involves all that? This sounds like an operating system you will be building :) But you can browse demonstrations.wolfram.com and see what kind of apps are there. Some are simple and some are more complex. Mathematia is more higher level language than C++. If you want to do lots of system level stuff, it might not be the best for that. But if you want to spend more time on the science and analysis and the GUI part, then Mathematica is best for that. It makes building GUI much simpler than Qt and Java. –  Nasser Nov 27 '13 at 20:12
12  
In my opinion, Mathematica is not great for this kind of application. Mathematica is great for interactive use, and also for creating functions that a user might work with interactively. But it's not well suited for making standalone GUI programs. It's great for making a quick and dirty Manipulate during interactive work, and much more convenient than anything else I know. But once you need to make that GUI refined, foolproof, and fast, it becomes very painful. –  Szabolcs Nov 27 '13 at 20:28
7  
I wish WRI would make an actual compiler that generates a .EXE. Matlab has one (even though the generated code runs at the same speed as the interpreted version since it is not a real compiled native, but to Matlab pcode, but runs under a run-time library (the actual engine), which is native), it still allow one to make a .EXE of a Matlab GUI apps. I think WRI can make a similar thing. That will go a long way to making Mathematica more used. Make it free compiler, no restriction. –  Nasser Nov 27 '13 at 23:46

2 Answers 2

As an Eterprise CDF user, I can say I have really tried, and my current opinion is that creating a standalone GUI program with the Wolfram Language is not an easy/commercial/deliverable task at the moment. Here are my points:

  1. All the interface controls are very limited. You will have a lot of difficulty to do basic things like make Tab jump between fields, make your interface evaluate when Enter is pressed, or just put form fields in the right positions.
  2. For free text fields, export to clipboard or create a pdf/xls/txt file with your report is possible only with the Enterprise version.
  3. To distribute the program you (and anyone who recieves it) have to install Mathematica Player, you can't create a standalone executable. It's strange to use a language that can't be easily delivered.
  4. You can't pack your CDF in one file. For big projects, you need to distribute a folder with a file structure inside it, which is very clumsy.
  5. Normally, when you use Dynamic or something similar, your CDF opens with a gray screen with a button that have to be unblocked, giving your work a very unprofessional appearance. enter image description here
  6. You need to see Mathematica advertise ever time you open your Mathematica Player (even in Enterprise edition). enter image description here
  7. You can't hide things like database connections inside your code, it's very easy to get the string inside java components. For business applications, you need to refresh data dynamically, and you can't do this in a secure way.
  8. Lack of complete/structured code examples with database connection, nice GUI interface and professional look. You can find some very specific examples like these at wolfram.com, but only very simples toy examples.

These are the main reasons I don't recommend CDF for professional standalone applications, in my vision they are good for toy code, students and individual data exploration. I loves Mathematica, but today I have given up developing this kind of application in CDF, maybe Wolfram Language might do something better in the future.

share|improve this answer
1  
About #1, just try to make "Tab" and "Enter" works... Try to designe e nice frame with some fields and make the data be validated without use regular expressions. You have need a lot of dynamics with EventHandler, with very unstable behavior. –  Murta Nov 27 '13 at 23:03
3  
#5, it's not a good designe. Imagine today, my users have to open the Mathematica Player, see the advertise screen, click on Enable Dynamics, all the time. –  Murta Nov 27 '13 at 23:08
1  
rere #4 Yes, you can put all in a giant DynamicModule, but your code get a mass for big projects, impossible to debug in small pieces. There is no SaveDefinition for it as we have in Manipulate. If you want to change part of you code, you have to take all it to outsite the DynamicModule, change it, and put it there again. This is all solved using packages. –  Murta Nov 27 '13 at 23:16
1  
Actually there is a SaveDefinitions. It is undocumented but is there and it works. Rolf Mertig drew it to my attention. But having said that I never use it. My current project is about 60 pages of code and i have no issue testing all functions separately but including all code within one DM and having it initialize. –  Mike Honeychurch Nov 27 '13 at 23:25
1  
I completely agree with your points Murta, though I did give up development much earlier due to the lack of detailed examples, limitations and not being standalone. It really makes distributing stuff among colleagues nearly impossible. I also edited your words, hope you don't mind (though I left the very stylistic "I loves Mathematica" in order to maintain uniqueness :) ) –  István Zachar Nov 30 '13 at 12:20

My experience is that while Mathematica does present some headaches with creating consistent layouts the limitations in creating a professional looking app are limited by your ability to do graphic design. For example most reading this could create a web page. But how many could create a cool looking web page? So there are two aspect: underlying code and functionality and interface appearance. The later is the domain of graphic designers. I certainly do not have abilities in this area but given a layout provided to me by a graphic designer IMO anything would be possible in a Mma interface.

With the caveat that I am aesthetically challenged, here is an example of a simple plotting interface. Some tabs at the top to tab between a plotter and user preferences. Some buttons. Some openers.

enter image description here

Click on the import data button to import data from an Excel file and select columns

enter image description here

Plot the data:

enter image description here

enter image description here

For me the limitations are my imagination [which can be a big limitation :)]. Which is not to say that this couldn't be done easier in another language, just that a lot more can be done with Mathematica than I think people realize.

share|improve this answer
1  
+1 Beautiful CDF. I miss real examples like that in Wolfram page. It's all this code inside one DynamicModule block? Or you use Manipulate with SaveDefinitions? –  Murta Nov 28 '13 at 0:45
1  
@Murta the functions are developed in a separate notebook and saved as a *.m. I then cut and paste all the functions from *.m into Initialization:>{ paste}. For me it is not such a big deal to do that. This is one single DynamicModule. I do not use SaveDefinitions. If I have this in a non trusted path unfortunately the warning is displayed. Wolfram need to provide a means to override this but I think you can in CDF Enterprise?? But I have actually installed this as a palette for plot styling so no warnings. –  Mike Honeychurch Nov 28 '13 at 0:58
    
@Murta I learnt a lot from the webaddashboard CDF made by Wolfram. It is worth taking the time. –  Mike Honeychurch Nov 28 '13 at 1:02
    
Unfortunately current version of CDF Enterprise (V9) don't fix it. I understand the way you work. In my flow, I have two big standard packs with a lot of functions that I always use (database connection, company standard layouts, personal functions). The code get confuse if I have to copy and past it all the time I change some functions inside this, so I prefer to delivery the separated files using Import inside DynamicModule with Initialization (with the onus of the folder structure). –  Murta Nov 28 '13 at 1:07
    
@Murta last year I did write some code to collect functions tagged in a certain way and stick them in Initialization as part of a build of the DM but there were occasional fails and eventually I just found cut and paste just as easy. –  Mike Honeychurch Nov 28 '13 at 1:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.