Giter Site home page Giter Site logo

midlang / mid Goto Github PK

View Code? Open in Web Editor NEW
72.0 72.0 6.0 1.09 MB

mid is a generic domain-specific language for generating code and documentation

Home Page: https://midlang.org

License: MIT License

Go 97.89% Shell 1.65% C++ 0.46%
code-generation code-generator domain-specific-language dsl go golang template

mid's People

Contributors

mkideal 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mid's Issues

Parse template file meta information

Template file can contains a optional meta header, e.g.

---
dir: aaa
file: {{.Name}}.go
var1: xxx
var2: yyy
---

{{/* Template body */}}

The meta header starts with a line --- and ends with a line ---. Contents of meta contains many key: value pairs.

The structure of meta maybe like:

type TemplateMeta struct {
	Dir    string
	File   string
	Date   string
	Values map[string]string
}

protobuf

just wanted to aks a few things.
this looks really good.
I like hwo the templates are seperated into parts. Makes it very easy.

I currently work with protobufs, goang, c++ and QT.
SO at the moment i am using this:
https://github.com/moul/protoc-gen-gotemplate
Its nice and generates the GRPC with any bindings because its based on gokit.
Here is a good example: https://github.com/moul/protoc-gen-gotemplate/tree/master/examples/go-kit

SO this gets me a Service and Client and structs.
Not bad but i also need to gen a fair bit of database code (using boltdb), a file storgae layer (using minio), and some c++ and QML (for client).

So you seem to be using your own DSL as a basis to gen from, and i was thinking how best to map to it. Any ideas ?

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.