AngryKiwee

What programming Language is Affinity Designer written in?

21 posts in this topic

Hey guys, 

 

Just out of curiosity what programming language is Affinity Designer and Photo written in for Windows? You guys using C++

 

Are we going to be able to write our own scripts with Python by any chance? as it's a bit simpler than Javascript I find.

 

Thanks :)

Petar Petrenko likes this

Share this post


Link to post
Share on other sites

Hey guys, 

 

Just out of curiosity what programming language is Affinity Designer and Photo written in for Windows? You guys using C++

 

Are we going to be able to write our own scripts with Python by any chance? as it's a bit simpler than Javascript I find.

 

Thanks :)

 

Affinity is mainly written in C++ with the Mac version front-end written in Objective C. Scripting will be Java script as we feel this will cover the largest use cases people want.

AngryKiwee likes this

Share this post


Link to post
Share on other sites

Good to hear the scripting will be in javascript. Any idea when this scripting is going to be available ?

Share this post


Link to post
Share on other sites

I would also prefer python, but javascript is good also.

When will we get scripting available? Any timeframe?

And, will the scripting just be a glorified "macro" with possibility to add conditionals or will we be able to add new tools and/or commands through scripting?

Petar Petrenko and AngryKiwee like this

Share this post


Link to post
Share on other sites

I would also prefer python, but javascript is good also.

When will we get scripting available? Any timeframe?

And, will the scripting just be a glorified "macro" with possibility to add conditionals or will we be able to add new tools and/or commands through scripting?

Great question, I would like to know this also.  :)

Share this post


Link to post
Share on other sites

This is definitely a great questions to ask. I know plenty of sites I could learn Javascript from.

Share this post


Link to post
Share on other sites

interesting choice for JavaScript.

 

most design tools I use use Python for scripting Maya Blender Fusion ...

Petar Petrenko likes this

Claas Kuhnen

 

 

 

 

Faculty Industrial Design  -  Chair Interior Design - Wayne State University

 

 

Owner studioKuhnen - product:interface:design

 

Share this post


Link to post
Share on other sites

interesting choice for JavaScript.

 

most design tools I use use Python for scripting Maya Blender Fusion ...

 

add Krita to that.

I too would be much more excited about Python, not so much for Javascript. I guess it's another reason for me to learn Javascript even though I'm not too thrilled with it.

Share this post


Link to post
Share on other sites

add Krita to that.

I too would be much more excited about Python, not so much for Javascript. I guess it's another reason for me to learn Javascript even though I'm not too thrilled with it.

 

I don't mind learning scripting languages. Javascript tutorials are easy to find. After searching, so is python. Codeschool.com and Codecademy.com are two good resources to learn either. These are what I will use.

Share this post


Link to post
Share on other sites

I don't mind learning scripting languages. Javascript tutorials are easy to find. After searching, so is python. Codeschool.com and Codecademy.com are two good resources to learn either. These are what I will use.

 

I was using Codecademy for awhile, but their Python course is using version 2, I don't mind being familiar with the syntax differences, but I would ultimately rather not be learning on an old version. I also like FreeCodeCamp and will probably use both that and Codecademy when I do get around to picking up Javascript.

Share this post


Link to post
Share on other sites

From a programmers point of view there is nothing wrong with choosing Javascript, it's widely used and every browser has nowadays a halfway good working JS engine underneath. Also they will be in good company, since all mayor players (MS, Apple, Adobe, Google ...) do use it too in the one or other way. Performance wise JS is also slightly faster than Python.


☛ Affinity Designer 1.6.1 ◆ Affinity Photo 1.6.7 ◆ OSX El Capitan

Share this post


Link to post
Share on other sites

Just found this topic  :blink:  anyway delighted to hear that a scripting language will definitely be implemented in AD/AP. I'm somewhat surprised but happy it will be JavaScript, one less thing to learn! I'd really be able to integrate this into some projects at work (ie a business copy just on that one feature)
 
The big question though.... WHENNNN!!!!

Share this post


Link to post
Share on other sites

Affinity is mainly written in C++ with the Mac version front-end written in Objective C. Scripting will be Java script as we feel this will cover the largest use cases people want.

 

I just saw this – having done scripting in both languages in different applications, I really, really, really hope this will be reconsidered when the time comes for that feature to be implemented.

 

I'm actually a bit surprised to read that statement since I literally can't think of any use case that JavaScript covers chat Python doesn't, usually even cleaner and easier.

 

Even basic things like splitting code into multiple source files and deriving from classes provided by the host application (say, MenuCommand, UiPanel, or FillerTextGenerator) are maddening and frustrating experiences in JavaScript, if they are possible at all.

 

Imagine use cases like a basic InDesign IDML importer for Affinity Publisher. With an existing Python XML parser package, this is a fairly straightforward task. Or a "Place Article from RSS feed" command. Network access and RSS feed parser come standard with Python without installing anything and would make that type of thing a matter of only a few lines of code. With Adobe-type JavaScript scripting, I'd probably give up the idea of writing that script before even starting.

 

Not to mention you guys would have a much easier time developing and maintaining the C++ host side if you can use boost::python versus some raw JavaScript engine API.

 

Also, JavaScript will likely run scripts in separate engine instances for each script to avoid clashing function names and the like, making it really hard to communicate between different scripts, share code between commands and so on. Even running specific functions defined in a script file from the interactive script console etc. may be impossible.

 

I realize that some folks favor JavaScript because they are already familiar with it, but I don't see how someone who is used to JavaScript wouldn't be able to easily pick up the necessary Python basics within a matter of minutes and be at a point where they could write pretty much everything they could in JavaScript in Python as well.

 

The only real issue I see with Python is that all that power may clash with Apple's AppStore sandboxing rules.

Petar Petrenko likes this

Share this post


Link to post
Share on other sites

Hello everyone, I do not believe that affinity can be written in c++, but rather in c# considering the windows uwp cannot be modified in c++ and that in wpf one can do it or in winform and I believe even they use visual studio with framework .NET if you look at the files well and same the .dll can be referred in c#. I have to even try to take again the same window and I made a success of it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now