stryku / cmakesl Goto Github PK
View Code? Open in Web Editor NEWAn attempt to introduce a new scripting language for CMake
License: BSD 3-Clause "New" or "Revised" License
An attempt to introduce a new scripting language for CMake
License: BSD 3-Clause "New" or "Revised" License
Designated initializers should be implemented, e.g.
class foo
{
int bar = 42;
string baz = "42";
bool qux;
};
foo f1 = foo{ .baz = "84"; };
// f1.bar equals 42
// f1.baz equals "84"
// f1.qux equals false;
Actually, this is under discussion. If you have any thoughts, feel free to comment here.
int main()
{
string s;
s = "foo";
return 0;
}
Produces error:
./CMakeLists.cmsl:4:8: error: string doesn't support operator =
s = "foo";
It should be implemented for:
token
sema_type
type_representation
type
++
, --
, -
, !
Mention
At this point void
type is imitated by instances of type bool
. Additionally, user is not able to declare e.g. a function returning void
.
void
type should be added to builtin types and handled wherever possible.
Parser tests should be moved to ast directory.
Explain
Currently, executing if-else nodes is not implemented.
Any malformed code leads to a crash. Sema tree can not be built but it is used at some point.
Example code:
int main()
{
non_existing_type foo;
return 0;
}
Hi,
I'm working on new build system and package manager called sw:
https://github.com/SoftwareNetwork/sw
(3.5+ years mature)
(https://github.com/cppan/cppan - first version implemented on top of cmake itfself)
I've implemented build DSL (frontend) in C++ already. You could take a look at sw.cpp file and specifications on the website.
Sw allows you to implement your own frontends for build system generator (backend).
For example, we could implement real cmake frontend for sw.
Maybe you'll be interesting in such thing without re-implementing C++ in your project.
Feel free to ask any questions.
Stuff to handle:
class Foo {
int bar;
};
class Baz {
Foo foo;
};
int main() {
Foo foo;
Baz baz;
baz.foo = foo; // fails
return 42;
}
cmake_parse_arguments
should be used as a method to parse arguments in our utils code
Type deduction should be implemented for variable declaration, e.g.:
auto foo = bar + baz;
CMakeSL should handle comments like the ones from C++: //
and /**/
Create Travis CI script and enable CI on the site
class int {}; // error
enum return {} // error
// etc...
CMakeSL should be able to accept variables from outside, e.g. from command line arguments.
Those variables should be visible inside the scripts, as a regular variables, so the user can use them.
isset(foo)
is a good example of operating on such variables. It 'returns' whether a variable with a given name exists.
string foo() {
return 42; // Should raise error
}
CMake with integrated CMakeSL doesn't build on Windows (tried with VS 2019)
int main()
{
project foo = project("Foo");
executable bar = foo.add_executable("bar", { "bar.cpp" });
executable baz = foo.add_executable("baz", { "baz.cpp" });
baz.link_to(bar);
return 0;
}
Leads to such an error message:
./CMakeLists.cmsl:6:10: error: No matching function for call
baz.link_to(bar);
^^^^^^^
<unknown source>:0:0: note: candidate 'link_to'. Type of parameter at position 0 does not match
** \brief The builtin executable type.
^^^^^^^
./CMakeLists.cmsl:1:1: error: parsing failed, can not execute
class foo
{
int bar = 42;
};
Deduction of a function return type should be implemented, e.g.:
auto foo() {
return bar + baz;
}
auto foo_void() {}
// Should not compile because return expressions produces instances of different types
auto foo_error( bool flag ) {
if( flag ) {
return 42;
} else {
return "42";
}
}
CMAKESL_WITH_EXAMPLES
option should be introduced to make examples optional.CMAKESL_WITH_TOOLS
option should be introduced to make tools optional.User should have possibility to log, print, assert etc.
cmake::message();
cmake::warning();
cmake::error();
cmake::fatal_error();
Such construction {}
in such context list<int> foo = {}
should be treated as an empty generic list, which can initialize list<int>
as an empty list.
Empty initializer list should not be allowed while declaring a list with auto
type:
auto foo = {}; // error
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.