Hello! Just stumbled on Wren yesterday (via the bytecode chapter in Game Programming Patterns) and really liked the design. I have long wanted to find a nice, clean, easily embeddable language I can use in an open-source C++ CAD library I'm working on and I've always found Lua's syntax awkward - Wren seems to fit the bill perfectly.
I'm also quite excited about the embedder-controlled import resolution system - I think there are some really cool possibilities there with doing automatic dependency fetching (kind of like Groovy's Grape).I'd certainly like to help out any way I can - to start, is there any interest in having a CMake build option for Wren?
Either way, I'll probably start playing around with using the embedding API - any particularly dark corners there I should know about/stay away from?
I thought about it when I initially set up the project. Trying to find the simplest way to manage the builds for a cross-platform C program is suprisingly tricky. Most meta-build systems (autoconf, gyp, etc.) see more complex than the problem they're trying to solve to me. These days, I figure you can cover 99% of the world by just maintaining a Makefile and a VS proj.At the same time, a lot of people do seem to use CMake. What advantages do you see it adding?
The embedding API is probably all dark corners at this point since it hasn't been battle-tested much (well, at all), but this is hugely important for Wren and I would be delighted to have you beat on it and see what breaks. If (when) you run into issues, I am highly motivated to fix them.
Hi,
From my previous projects there is at least on issue to be aware of with cmake.
Afaik you can't make static and dynamic builds at the same time. It can be problematic if you want modules as a .so while generating a vm as a .a on unix.
For the rest you can pretty do all the same.
--
You received this message because you are subscribed to the Google Groups "Wren" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wren-lang+...@googlegroups.com.
To post to this group, send email to wren...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wren-lang/63fca201-5e21-4f93-a678-943bc0bd83f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I thought about it when I initially set up the project. Trying to find the simplest way to manage the builds for a cross-platform C program is suprisingly tricky. Most meta-build systems (autoconf, gyp, etc.) see more complex than the problem they're trying to solve to me. These days, I figure you can cover 99% of the world by just maintaining a Makefile and a VS proj.At the same time, a lot of people do seem to use CMake. What advantages do you see it adding?Well, the immediate reason was that Visual Studio 2012 is the version I happen to have installed right now on my home computer, and I always get a bit nervous about having multiple versions of VS on the same machine (it *should* work, but I've been bitten in the past by installers/uninstaller glitches) so I didn't really want to install VS 2013.
CMake makes it easy to generate solutions for whatever version of Visual Studio you happen to have lying around.A few more general advantages:
- Only have to maintain one official set of build files for all platforms/compiler versions. I never quite trust projects that have a 'Windows' subfolder somewhere with VS solution files that may or may not work or be up to date - I appreciated that you were honest that the Makefile was the only 'official' method =).
- CMake provides a pretty nice, consistent way to set build options - it's easy to add variables (with docstrings) which can either be set at the command line, through ccmake (ncurses-based UI) or the CMake GUI. (It's pretty nice to fire up the CMake GUI and have it present you with a bunch of BUILD_STATIC_LIBS, INCLUDE_ICU_SUPPORT etc. variables with checkboxes beside them when you're trying to figure out how to configure and build somebody else's library!)
- CMake includes some pretty comprehensive platform introspection built in - check for Linux/Mac/Windows/MinGW/Cygwin, 32-bit vs. 64-bit etc.
There are lots of other nice CMake features ('cmake -E' mode for cross-platform cp/mv/rm/tar/md5 etc. utilities, ability to add custom build steps if necessary, good support for handling stuff like __declspec(dllexport) crap on Windows) but I think fundamentally what it comes down to is that I've always found CMake-based projects to be quite pleasant to set up, and third-party libraries using CMake to be quite easy to configure and build. Although to be fair I spend most of my coding time at work using Visual Studio, and for the Windows/VS ecosystem perhaps CMake is just the best of a bad lot.
The embedding API is probably all dark corners at this point since it hasn't been battle-tested much (well, at all), but this is hugely important for Wren and I would be delighted to have you beat on it and see what breaks. If (when) you run into issues, I am highly motivated to fix them.=) I will start giving it a try soon. One thing I noticed was that I couldn't see an easy way to handle nested relative module imports since the embedder has no easy way of knowing which module a load-module request originated from - I might add a feature request with some ideas on GitHub after playing around with things a bit.
One thing I try to keep in mind is that most users of Wren will likely use it directly from source. Anyone whose using the CLI that comes with Wren of course needs to build it directly. But if you're embedding Wren in your own application, my hunch is people as likely to just drop the whole src/ directory into their project as they are to build it separately and link it in.
Ah, yes! This is, strangely enough, a corner of programming languages I have a lot of experience with. I wrote the package manager for the Dart language so I've spent more of my life than I probably care to thinking about how imports should be located.
One thing I try to keep in mind is that most users of Wren will likely use it directly from source. Anyone whose using the CLI that comes with Wren of course needs to build it directly. But if you're embedding Wren in your own application, my hunch is people as likely to just drop the whole src/ directory into their project as they are to build it separately and link it in.That's a good point, and I've actually started doing exactly that myself (I now have Wren compiling happily embedded within my own CMake build system). In that case, what are your thoughts on having an auto-generated amalgamation source file like the one suggested in this pull request?