r/ProgrammingLanguages • u/Martinsos Wasp (https://wasp-lang.dev) • Feb 22 '20
Brother and I are developing a declarative DSL for building full-stack web apps - would love to get feedback / advice!
Background: Brother and I have finished Master’s in CS, and our main experience with building compilers was during college, where we wrote a compiler for subset of C, in C.
We have spent most of our time last years developing web apps, and we got this idea that it would be great to have a higher-level domain-specific programming language that would abstract away a lot of boilerplate in developing a web app, but of course still allow you to customize it with your business logic.
That is how we started building Wasp (https://wasp-lang.dev) and have just finished building (after a year, as side project) the first prototype! It is not yet powerful enough to be used for real development, but it should demonstrate some very basic concepts.
Language is pretty simple, it is a DSL and is not general-purpose (for now) - currently it is more of a configuration language.
We have built compiler in Haskell, and it consists currently of parsing step (lexical + syntax analysis in one, no semantic analysis yet), which results with some kind of AST, and then generation step, which generates “file drafts” containing js/htmls/css and similar, and final step (trivial for now) which creates actual files (generated code) based on those file drafts. We see ourselves adding more steps in the future, to parser for semantic analysis and to generator in order to manage complexity.
Wasp is still really early, and we would love any feedback - what do you think about the concept, design, implementation, do you find landing page / github repo clear … .
Some extra questions / food for thought:
- We have not used any specific methodology for designing Wasp, instead we picked a simple app (todomvc.com) and designed minimal language needed to develop it with Wasp. Next step is to pick a bigger app and continue with this approach. So “use-case driven development” (just made that up :D). I would love to hear if you have some suggestions, is there a better approach to this, maybe some methodology that you used or would recommend?
- Is there something we are doing wrong, regarding design or implementation that you see immediately obvious?
Link to github repo, with all the code: https://github.com/wasp-lang/wasp .
Thanks a lot, and I am looking forward to participating in this subreddit :)!
7
u/negative_epsilon Feb 22 '20
This is a really cool project! Congratulations on your first release!
As I was reading through the examples on Github I was thinking about the best use cases for something like this. I think something like this could be super useful for rapid prototyping.
The examples did leave me with the biggest burning question of how to add business logic to the backend that would, say, attach to one of the CRUD tasks, but I understand it's in a very early state.
I can see a fun future here with perhaps compiler generation step plug-ins, if you choose to write it this way. Something like, "favor Vue over React or Cassandra over Mongo? Compile with this flag!", and a community of plug-ins that can take subsections of your AST and output the specific layer it cares about.
5
u/mrpogiface Feb 23 '20
I think this is neat. Potentially name space issue?
https://github.com/wasplang/wasp
3
u/paul_h Feb 22 '20
4GLs of the 90's (Synon and others) in enterprise use sometimes forced the dev team to hit the eject button and edit the generated code. Your No-Lock-In "feature" (https://screencast.com/t/JLuY8Q2Yr) will be used that way. Back then, this was not-good situation. I'm not sure it is a good feature not either.
I myself prefer "pseudo-declarative" for these techs, as thet containe if-condutions and for-loops. e.g 1993's HTML was declarative, and 2009's AngularJS was pseudo-declarative (it had
ng-ifandng-repeatas attrs for arbitrary HTML elements).Lastly, a question: say the both of you had a epiphant that VueJs v6.72 (doesn't exist yet) was way bestest tech for TheDOM and wanted to flip to it as a target for the compiler: would there be anyway code changes for the user community?
2
u/jdh30 Feb 24 '20
Wonderful project!
I think your methodology is spot on: minimum viable product then feedback and repeat.
The one thing that jumps out at me is that it looks like you need to install software to use it. Why not have the whole thing running in the browser?