On Sep 17, 9:33 am, Brian <brian.fores...@gmail.com> wrote:
> As a Java programmer coming to Clojure I would be very interested in the
> intended application.  How you approach that from a Clojure perspective is
> what I'm interested in.  I've programmed in Lisp in the distant past
> (Symbolics Lisp machines) and still have very found memories of that
> environment.  Having programmed in C -> C++ -> Java since then ... well I
> just miss the edit run test cycle that was so natural with those Lisp
> machines.

I'll give you guys a brief overview of what I want to do. I'm sure
that as Clojure enthusiasts you will want to say that Clojure can do
anything. On the other hand, you might tell me that Clojure is a bad
fit and that I would be better off with xxx, and I would appreciate
that advice too.

I want to create a DSL for generating gcode for cnc milling machines
and lathes, and maybe even more complicated machines such as 5-axis
laser cutters. I need a language (possibly Clojure) that is simple
enough to be used by non-programmers whose only background in
programming is writing gcode.

My first choice was Forth. That is by far my own favorite language. I
am considering Clojure primarily because it offers a macro facility
somewhat comparable to Forth compile-time words, which I think is
necessary for writing a DSL. Also, it is similarly interactive, and I
can't really ask the users to compile a program and then trace it in a
debugger --- especially as I consider that to be a clumsy technique
even for me to do. I know that languages such as Groovy and Ruby have
been used for writing DSLs (Grails and Rails), and they don't have
compile-time code, but I don't really understand that kind of
programming --- I've been writing compile-time code all of my life and
that is my standard technique for simplifying programs. The reason why
I am considering Clojure rather than just going with Forth is because
I am interested in Clojure's focus on sequences and laziness. I see
this as a trade-off between thinking about programming in terms of
time (procedural, like Forth) and thinking about programming in terms
of space (sequences, like Clojure). I think that machinists would be
more comfortable thinking about space than time because they generally
work with physical objects that exist in space, and what they
primarily struggle with is thinking about time, which is what raw
gcode is all about.

One other thing that I need is security. I had considered using
Factor, which is a Lisp/Forth hybrid. I don't think this will work
though because I can't make a language like Factor available to
machinists. The company owners would worry that these guys would trash
the data on the computer's hard-drive and/or use the language to write
computer games and generally goof around on company time. The company
owners are only going to be comfortable with allowing their employees
to program if this programming is done in a sandbox. Pretty much any
language that is written on top of another language will provide this
security. For example, Lua or FICL could be used so long as it is
crippled in such a way as to prevent the user from accessing the hard-
drive or the internet or anything except his own sandbox. Still
though, I can't just write a gcode library in C++ or Factor --- I
would need to write a scripting language on top of C++ or Factor that
provides a safe environment separate from the underlying language.
Clojure should work well because the JVM is a sandbox. There is also
more depth there because the entire Java system would be available to
the user, and still be secure. By comparison, with Lua or FICL the C++
system is not available except for any libraries that I (laboriously)
write wrappers for. With Clojure I would get the depth of the Java
system, while still having the simplicity of Clojure --- I don't want
to try to tell machinists that they need to learn Java, especially as
I consider that to be a pretty daunting task even for me to do.

You mentioned having come from a Common Lisp background. Would you
recommend CL rather than Clojure for what I'm doing?

Do any of you have experience writing raw gcode and/or using some kind
of CAM software to generate gcode?

Are any of you Forth programmers?

BTW --- all of you seem to like "Thinking in Java," so I will start
with that one.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to