0
\$\begingroup\$

I'm developing a webapp where some parts that repeat, so I made source code to generate source code.

I had a lot of fun using Spring-Roo and Grails in the past but was sad that the difference between script and template becomes mind-blowing.

So, for fun I created my own compressed language and scaffold to Typescript, Lesscss and Java.

/* for-loop filling a select with options */
<select>
  {{for localhost:8081/ myoptions = 
                  SELECT
                      o.name as optionname,
                      o.id as optionvalue
                  FROM
                      Options o
                  WHERE
                      o.company.id = :companyId}}
    <option value="{{optionvalue}}">{{optionname}}</option>
  {{/for}} 
</select>

{{less: 
  select {
    background: red;
  }
}}

The generated classes pass pmd, findbugs, tslint and checkstyle except for the documentation (jsdoc, javadoc).

The HQL can be nested. The parameter companyId is from an outer for-loop.

eTag, CSRF and cross-site-scripting-protection work under the hood. If I change the code the server recompiles, deploys and reloads the microservices as OSGI bundles (example using localhost as domain and port 8081) and the browser immediately refreshes the website within a second (I have a fast workstation).

The JSON from server to client looks like this:

{"myoptions":[{"optionname":"Hello","optionvalue":1}]}

Hence my rad-code is not production-ready, but the generated Java and Typescript are.

Since this is the source source code, I'd like to review that.

Any considerations?

\$\endgroup\$
1
  • \$\begingroup\$ It seems like you're asking for a review of a section of home-grown language. Please carefully read codereview.meta.stackexchange.com/questions/10522/… . If we don't have access to the interpreter, then it seems unlikely we'd be able to meaningfully review this. \$\endgroup\$
    – Reinderien
    Mar 10 at 15:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.