There is a GSoC and they are looking for volunteers to work onto projects. My idea was to use Nim because then the speed of programming can increase drastically.
I posted in this thread https://forum.freecad.org/viewtopic.php?p=659000#p659000 and also the rest of the thread because in the end I say something more.
FreeCAD uses ATM C++ and Python. There is nothing wrong with Python except that Python is slow and I hate C++ to program in because it has so many stupidity inside it.
So my idea is to use a second extension language next to Python, because Nim is so much more powerful than Python. Well, read my post and also the rest of the posts if you are interested into programming with FreeCAD and want to participate in a GSoC.
Your job will be to make Nim work with FreeCAD and also to create the wrappers, so that in three months FreeCAD is completely tooled up with Nim.
Gerard
It should be pretty simple. I did a similar job with Unbound for work. Took the existing Python extension capabilities and created a PR which added a similar interface just using dynamic libraries instead. Then I wrapped all the internal structures and procedures in Unbound using Futhark. Then it was just a matter of writing my DLL and so files in Nim with full access to what Unbound offered. Not only did the speed of my extension dramatically increase, but I was also able to access things in Unbound which simply weren't exported in the Python interface and I avoided all the C -> Python -> C conversions.
FreeCAD being C++ means Futhark isn't going to be able to automatically do the conversion, but creating some C headers for the dynamic library interface shouldn't be too much trouble.
I don't know why people use always acronyms for the most significant part of the message not ever using the word once.
Nothing against grd... I have seen this everywhere...
Some time ago I raised a similar topic in this post. I'd love to see Nim working with Freecad too.
Nonetheless, I thing it will require a lot of effort (from my naive point of view). How to add an add-on is explained here. But I think that it will require bindings to huge libreries:
I worked a lot on OpenCascade. You can find occt.nim useful for this activity.
We have seen in the forum some progress in the Qt front with nimqt.
I think Coin3d bindings would be needed.
It would be interesting to have a Geometric Constrain Solver in Nim too. The low hanging fruit could be some bindings to Solvespace's constrain solver.
I hope somebody takes this to the right level (I don't have enough knowledge). I wish we could do things like cadquery in nim too.
@grd
The downside of Nim is that the integrated Python prompt doesn't work What are you talking about ? Are you talking of Inim (which is not an integrated Python prompt) ?
Can you tell us more about FreeCAD in the first place ? Are there examples of professional project that uses FreeCAD ?
Just wrapping FreeCAD does not seem really attractive. It adds an abstraction layer, and forces people to juggle with three programming languages, rather than simplifying it. You will also have to update the bindings along FreeCAD C++ development. Correct me if I am wrong.
I agree though, it will probably make the project compile much faster. C++ compiling times for such huge libraries are probably horrible.
Lots of replies. I am gonna reply some of them. Sorry.
@nasl, you can be right, unfortunately. The problem is well known. They are all volunteers, which means that you have good ones, bad ones, but most of all is that they have other work and doń't do it full-time. That is why now they have at freecad.org a blog for which shows the progress and now they have money but I don't know how to generate the money. I am a mechanical engineer by profession and I don't like Fusion360 because they like to pull strings.
@dlesnoff,
I don't know any professional project that are using FreeCAD and that is the problem. FreeCAD to me is still a hobby project. I mean, they still don't have materials inside the PartDesign WB and we all know that materials are essential and the assemblies are also sh*t and that is a shame for a project that lasts for so long and that is why I think that using Nim could make a difference because then you don't need to write C++ anymore and you have a GC that could help quite a lot.
@mantielero, yes I saw your work and I love it ;) I agree with all your points. But nimqt is not some progress. It is darn good. Yes I agree, a lot of work needs to be done but once done I think that it could help FreeCAD a lot. I can be wrong of course but I don't think so. Have a look at my post here https://forum.freecad.org/viewtopic.php?p=659732#p659732
@PMunch, simple I don't know, but a lot of work, that I do know ;) I think that the problems are the multi-platform aspects probably and once that is done then I agree it should be simple, but I think that it is a lot of work and that is why this GSoC would be ideal. But doesn it cause issues? Of course.
@Cnerd, I think that you can make a post at here https://forum.freecad.org/viewtopic.php?p=658500#p658500 and say that you are a student who is interested in Nim and from there on I think that someone will contact you. If you want to have more information then you can also look at this post https://forum.freecad.org/viewtopic.php?t=75942
I think Coin3d bindings would be needed.
TBH I don't know Coin3d enough to answer that question. But if it does than we need to write a wrapper.
It would be interesting to have a Geometric Constrain Solver in Nim too. The low hanging fruit could be some bindings to Solvespace's constrain solver.
You are completely right. Do you mean the idea that Zolko did have?
A good unified measurement tool. A VERY good measurement tool.
I am sorry but I don't know Solvespace enough.
At the FreeCAD meeting of a week ago a lot of new ideas were mentioned. Or maybe the ideas were brought back to live, I don't know, but right now to me it is clear that there is a will to develop and I think that using C++ is probably one of the biggest issues that they have.
Coin3d is used for the rendering bit AFAIK.
I think Zolko talks about improving the measurement tool within FreeCAD.
Geometric Constrain Solving is about finding a solution when you define constraints between geometric elements, such as A tangent to B or C perpendicular to D. If you use FreeCAD's sketcher, you get a good feel about what GCS is.
Solvespace is another parametric CAD system. Surprisingly good to be honest. Their GCS is provided as a separated library here. I played with it too, but I don't remember how far I got (see solvespace.nim).
Interesting, Solverspace is what CAD sketcher, add-on for Blender, is using: