DSL environment to do HTTP restful API call
DSL environment to do HTTP restful API call
We have a DSL
We would like to create an environment to enter our language
As we enter a program using our language, we would like this environment to allow us make a real-time http restful calls to help us determine specific field values in the environment.
As we enter the program, we would like to smart copy (eg clear out some fields) from other programs that were previously entered in this environment.
Upon finishing entry of our program, we would like to validate our DSL entry, and have the program convert what we entered into a series of http restful calls that will let an external system know what we created.
I think we have become relatively well versed in MPS, but we are confused at the highest level. Any high level 'go do this' would be greatly appreciated. At a high level what is the environment described above written in? (MPS, Embedrr, Swing)?
We have a DSL
We would like to create an environment to enter our language
As we enter a program using our language, we would like this environment to allow us make a real-time http restful calls to help us determine specific field values in the environment.
As we enter the program, we would like to smart copy (eg clear out some fields) from other programs that were previously entered in this environment.
Upon finishing entry of our program, we would like to validate our DSL entry, and have the program convert what we entered into a series of http restful calls that will let an external system know what we created.
I think we have become relatively well versed in MPS, but we are confused at the highest level. Any high level 'go do this' would be greatly appreciated. At a high level what is the environment described above written in? (MPS, Embedrr, Swing)?
Please sign in to leave a comment.
a very basic and probably the simplest way to do a REST call within MPS is to create a little tool using the baseLanguage. Create a new class, open a connection to your HTTP server and write a REST request on that connection.
If you have more REST stuff to do, you may consider using a REST client framework. Add the jar(s) in the lib dir in your language or solution (depending on the decision if you do the REST in your language or create a runtime solutions), import the java stubs and call the library methods.
From the little info you've given, I'm questioning if this is a good fit for MPS, or maybe you're thinking at the wrong level of abstraction for an MPS-based approach. Could you give us more details on what you are trying to do, we can probably help you determine a good solution.
retrieve using REST from language models itself, right? So both server-side
information will be generated and client-side code completion will be also
available by making use of local models' information. Did i understood you
right?
On Fri, Jul 26, 2013 at 12:48 AM, Jens Nerche - Meta Programming System <
jetforum@jetbrains.com> wrote:
Items created with our language are then callable by name + value pair parameters. Created items can be called externally or they can be used within the language to create new items. So anything we create could in theory become usable as part of our language immediately.
As we create an item we would give it attributes (a1, a2, a3, etc). As we created an item, we were planning to store those externally. We were planning to store those and the source code in the internal MPS db.
Within MPS or some environment, as we are filling in a specific field, mps would http an external system for all created language elements of type 'a2', we would receive a list to populate there (I guess we could also query MPS db). At that point, based on attributes, we would load the original source code, a copy, or just the name of the program.
eg
New1 = step1 + step2 + step3
New2 = New1 + step4
New3 = New2 + step5
As we create new1, new2, new3 we want to give then attributes so we can find them later. We also want to treat then as 'language elements' – so they are in par with step1, 2, 3. Sometimes we want to display the source code of New1,2 sometimes not.
So we want to use the language itself to create more language elements, and we want to do this dynamically (what is created can be used right away). Ideally I would like to make no separation: that everything created is a language element that other developers can immediately take advantage of.
--
This is changing by the hour, but this is what we think right now:
Other possibility is forgetting about MPS and doing custom work:
Suggestions? questions?
I'm still trying to wrap my head around the details of your approach. It sounds like your language in MPS would have to be very generic/abstract to accomplish this. The trick is to not make it so abstract that MPS can't do much for you with regards to validation, type checking, etc.
Your statement "As we create something (as part of compile) store the attributes (telling mps in future how to use it) to external db" caught my attention. Remember that MPS is not a completely dynamic environment, i.e. when changes are made to the language definition, it still has to go through a generation and compilation step, although the changes are then (usually) seen immediately, without requiring a restart.
Also, although editing solution models programatically is easy enough using the SModel language, I'm not sure how this would work if your plan is to modify the language dynamically (which kind of sounds like what you want to do). In theory, each of the language models (structure, editor, generator, etc.) are just models that could be modified through the SModel API. In practice, I'm not sure how well MPS would cope with that - my gut tells me "not well". But maybe that's not what you are intending, and I'm just understanding it wrong.
create dynamic languages support in JVM. Basically there is much similarity
to that task if what you want to do is creating new concepts, modifying
behaviors etc. Or am i talking non-sense? Correct me, Mike, if i'm wrong
:-) (Does the former require reflection?) If on the other hand you just
want to create an interpreter of some sort with fixed number of fixed
language concepts then i think it could be done easier and i would anyway
suggest rather asynchronously update server information than to pull data
from there.
On Tue, Jul 30, 2013 at 12:28 AM, Mike Haney - Meta Programming System <
jetforum@jetbrains.com> wrote: