Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Josh Kutsko #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions context-free.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the point about mathematicians, hadn't thought of that. I guess some recursive/fractal style visuals would be easier here than elsewhere.


## 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.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also think about the random aspect to it.


## 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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are other more fundamentally difficult things to do, such as creating, say, "realistic" looking images like faces or nature. I think that you ran into valid difficulties, but they don't touch on actual downsides in the intention of the language. That is to say, the language intentionally doesn't support those types of images, as opposed to unintentionally being annoying to use.


## 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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I liked this about yours as well. My favorite parts were the elegance in the code and also the four subsections of colors (i.e. four "quarters") within the shape. Really, really cool and looks nice on the black as well.



32 changes: 32 additions & 0 deletions joshua_kutsko.cfdg
Original file line number Diff line number Diff line change
@@ -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]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This trianglehalo section is neat -- hadn't thought of it this way at all.

}
Binary file added joshua_kutsko_FAJ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions my-dsl.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that the game engine is playing against the user? is it user vs user? or how does it work?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I also think this is a bit confusing. What do the rules define? How many users are there? Is this to just test game design?


# 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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the program extensible or usable with other programs? can you create rules, boards etc and then maybe add nicer UI or graphics elsewhere?


# 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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only usable on Windows engine seems like a drawback! What do I know though, I am something of an Apple fanboy...


# 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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar concern to the one I had above -- I'd want to use this with other programs/software etc.


# 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?_

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add that Windows being a requirement is also a drawback.

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.