diff --git a/context-free.md b/context-free.md index 8d9c470..3276c19 100644 --- a/context-free.md +++ b/context-free.md @@ -2,21 +2,31 @@ ## Who is this programming language for? +This programming language seems to be primarily for graphic designers (either professionally or casually) who have some experience writing code and thinking mathematically. I could also see mathematicians who focus on geometry using it to play around with an idea, since it easily represents fractal images that would be hard to represent manually with something like TIKz. ## What is easy to do in this language? Why is it easy? +This language makes it very easy to represent very complicated and abstract shapes. For example, you can represent an "infinite" amount of shapes with just a few lines. Actually having to specify everything in the image would be incredibly hard, but Context Free allows you to recursively specify shapes with properties as the reccurence relation. ## What is hard to do in this language? Why is it hard? +There were a few issues I ran into with the language. + - First, I found it was occasionally hard to figure out what coordinates my images were centered around. Since the image window changes to fit your image, sometimes its hard to tell where the origin is. + - Additionally, the syntax error messages weren't very descriptive, so debugging in this language isn't easy. ## How did you learn how to program in this language? +I attempted to learn by looking at the documentation, but I found that a lot of the commands being abbreviated inconsistently made it hard to udnerstand. Instead, I looked at examples and tutorials that I found online until I figured out what worked and what didn't. ## What is the underlying _computational model_ for this programming language? _We don't yet have a great definition of the term "computational model". For now, try to come up with the clearest, most concise explanation of what happens when a ContextFree program runs._ +It seems like the process has 2 steps. First, when you decide to render the program you write, the IDE for Context Free renders the image in the side window. This is analagous to just running a code script and looking at the results. Second, when you're satisfied, a "completed program" can have its rendered image saved. ## What do you think is interesting about the ContextFree program you wrote? + +The thing I like about the program I wrote is its simplicity. The actual lines of code are quite simple, there are two main recursive shaps I defined, and I just put 8 of them in the image at various angles. However, the actual process of creating the image was just a series of repeatedly changing the hue and dimension and angle settings until I found things that I liked. So the program itself was always quite short, but went through many different configurations, all of which looked very different, until I settled on a theme. I think that's what I like about COntext Free, it lets you make very cool, unique images with very few lines of actual code. + diff --git a/joshua_kutsko.cfdg b/joshua_kutsko.cfdg new file mode 100644 index 0000000..4c19473 --- /dev/null +++ b/joshua_kutsko.cfdg @@ -0,0 +1,32 @@ +startshape COLORSPACE +//A modern-arty kind of thing, a bunch of fractals of different colors meeting in the middle of the image. +background { b -1 } + +rule COLORSPACE { + // The 4 fractals are almost 90 degrees apart, skewed by a few degrees because it looks cool that way. + CIRCLE_SPIRAL { hue 225 sat 0.7 b 0.4 } + CIRCLE_SPIRAL { r 91 hue 130 sat .7 b .9 } + CIRCLE_SPIRAL { r 185 hue 3 sat .8 b .9 } + CIRCLE_SPIRAL { r 277 hue 70 sat .8 b .9 } + TRIANGLEHALO { h 270.00 sat 0.0222 b 0.9294} +} + +//The fractal of circles, each one splits into 4 smaller circles in spirals of different angles. +rule CIRCLE_SPIRAL { + CIRCLE [size 2 x 5] +CIRCLE_SPIRAL [x 1 y 3 r 25 s .5 b 1.1] +CIRCLE_SPIRAL [x 1 r 45 s .5 b 1.1] +CIRCLE_SPIRAL [x 5 r 180 s .5 b -.1] +CIRCLE_SPIRAL [x 5 y -3 r 270 s .5 b -.1] + +} + + +// Creates the 4 triangle spirals coming out from the main circles. +rule TRIANGLEHALO { + TRIANGLE [ x 0 y 10 s .7] + TRIANGLE [ x 10 y 1 s .7] + TRIANGLE [ r 90 x -10 y -1 s .7] + TRIANGLE [ r 270 x 1 y -10 s .7] + TRIANGLEHALO [ r 10 s .95] +} diff --git a/joshua_kutsko_FAJ.png b/joshua_kutsko_FAJ.png new file mode 100644 index 0000000..bbc7e77 Binary files /dev/null and b/joshua_kutsko_FAJ.png differ diff --git a/my-dsl.md b/my-dsl.md index c510c6f..fef4fbd 100644 --- a/my-dsl.md +++ b/my-dsl.md @@ -2,37 +2,47 @@ _What is the name of the language? Link the name to its webpage (if appropriate)._ +[Zillions of Games](http://www.zillions-of-games.com/) is a board game scripting language. # Domain _Describe the language's domain in five words._ +Grid-Based Board Game Rules # Computational model _We don't yet have a great definition of the term "computational model". For now, try to come up with the clearest, most concise explanation of what happens when a program in your DSL runs._ +When a *Zillions of Games* file is loaded, the game engine creates a board game on the specified grid with the specified rules, and plays the game automatically. # DSL-ness _Fowler writes about a spectrum of languages, from general-purpose languages to "purely" domain-specific. Where does the DSL you chose fall on this spectrum, and why?_ +I would say that this language is very much a pure DSL. It literally only has one use-case, the creation of a board game that's played on a grid. If that's not purely domain-specific, I don't know what is. +I could see a similar kind of language, or an extension of this language being used to just draw things, but that's not the use case, and there are better tools for that anyway. # Internal or external? _Is the language implemented as an internal or external DSL? Justify your answer._ +This language is implemented as an external DSL. It's programs are created in their own separate files (.zrf files), and they run by themselves on top of the underlying engine. # Host language _What language(s) was (were) used to implement the DSL?_ +Zillions of Games was impemented on top of the Windows .NET framework, so it requires a running Windows engine to work. The actual language itself uses S-expression syntax, so it basically works like Lisp, but with functions limited entirely to defining the rules of the game. # Benefits _Identify one potential benefit of the DSL: how is a programmer's life or a company's bottom line made easier by the existence of this language?_ +I think the best way to answer this is with an example. Imagine you're a game company writing a game that involves smaller min-games as sub-content. Instead of having to write a new game engine entirely, come up with the graphics settings to make it look right, and write an AI for it, you could just write several tiny rule files that specify these games, and figure out a way to call them. Seems like a much simpler task. With that said, I'm not sure how customizable this is, so it might be the case that it won't fulfill your use case exactly. # Drawbacks _Identify one potential drawback of the DSL: what does a programmer or company lose by using this DSL instead of a general-purpose language?_ + +The main drawback of this DSL is probably just that its really specific in its domain. If it let you specify arbitrary games, not just board games on a fixed grid, then it might be better, but as it is, if a company decides to use this, and then needs something just slightly more complicated, they'll have to change systems completely.