News for hackers. Stuff that matters.
Re:Tcl Calling Parallel C++ Code Using OpenMP by nerdponx on Saturday May 29, 2021 @04:16PM (#27327956)
SWIG seems really powerful, but not very common in my experience. Why don't we use this more often to create bindings for the same important core libraries across multiple languages?
Re:Tcl Calling Parallel C++ Code Using OpenMP by elteto on Saturday May 29, 2021 @04:42PM (#27328102)
Oh but it is used a lot, just not out in the open. We use it to bridge millions of lines of C and C++ with millions of lines of Perl and Python. It is quirky but really stable once you get it going.
Re:Tcl Calling Parallel C++ Code Using OpenMP by nerdponx on Saturday May 29, 2021 @07:39PM (#27329230)
Are you able to share what kind of organization does this? What are pros and cons versus an FFI type of library?
Re:Tcl Calling Parallel C++ Code Using OpenMP by elteto on Saturday May 29, 2021 @10:34PM (#27330142)
How do you use an FFI with C++ classes? My understanding is that you must lower things down to C level, this is a lot of work and not all scripting languages have the same FFI.

SWIG automatically translates (to a certain degree) constructs in one language to another. So a C++ class becomes a Python class. Again, it needs some work to map these things but it mostly just works.

Re:Tcl Calling Parallel C++ Code Using OpenMP by pjmlp on Sunday May 30, 2021 @02:15AM (#27331007)
In Windows you make everyone speak COM, or the improved version UWP.
Re:Tcl Calling Parallel C++ Code Using OpenMP by ridruejo on Saturday May 29, 2021 @03:33PM (#27327688)
I’m surprised at how often Tcl makes it to the HN front page even it is not supposed to be a popular language. Even more surprised it is for relatively obscure topics.
Re:Tcl Calling Parallel C++ Code Using OpenMP by ppereira on Saturday May 29, 2021 @04:51PM (#27328146)
Many tools used in chip design are controlled with Tcl. It provides a stable repl for these heavy, multi-threaded, efficient, C++ programs.
Re:Tcl Calling Parallel C++ Code Using OpenMP by rkeene2 on Saturday May 29, 2021 @04:11PM (#27327927)
Tcl tends to get used in weird places, and is stable so has a high sticky-ness.
Re:Tcl Calling Parallel C++ Code Using OpenMP by smartmic on Saturday May 29, 2021 @05:56PM (#27328546)
I find it much more exciting to make such discoveries with old, stable languages than to follow the latest developments of hip languages. Much of what is invented or rewritten there again and again has been running with proven tools for decades. However, this is often only known to older graybeards who still use stable industrial code without wider open source visibility.
Re:Tcl Calling Parallel C++ Code Using OpenMP by markhahn on Saturday May 29, 2021 @08:18PM (#27329455)
Can we just call tcl a fetish programming language?
Re:Tcl Calling Parallel C++ Code Using OpenMP by blacksqr on Sunday May 30, 2021 @12:58AM (#27330723)
You've hit the nail on the head. There's nothing considered kinkier in the software world than wanting to create correct and useful programs in reasonable time using tools that minimize complexity.