Git Product home page Git Product logo

cmakesl's People

Contributors

doyouevencpp avatar stryku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cmakesl's Issues

Implement designated initializers

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.

Missing string::operator=

int main()
{
    string s;
    s = "foo";
    return 0;
}

Produces error:

./CMakeLists.cmsl:4:8: error: string doesn't support operator =
    s = "foo";

Improve readme

Mention

  • tools
  • function overloading
  • errors
  • classes
  • type safety
  • youtube video
  • cmake integration
  • memory managment

Implement void type

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.

Improve user guide

Explain

  • type safety
  • function overloading
  • no conversions
  • classes
  • generics
  • initializer list
  • memory managment

FYI: sw project

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.

isset() and similar features

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.

executable::link_to error points to a wrong position in the executable documentation file

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

Introduce function return type deduction

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";
    }
}

Examples and tools should be optional

  • CMAKESL_WITH_EXAMPLES option should be introduced to make examples optional.
  • CMAKESL_WITH_TOOLS option should be introduced to make tools optional.

Logging, printing, asserting etc.

User should have possibility to log, print, assert etc.

cmake::message();
cmake::warning();
cmake::error();
cmake::fatal_error();

Allow empty initializer lists

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.