Re: Clojure for high-end game development

2009-05-22 Thread jdz

On May 21, 9:35 pm, tcg  wrote:
> You would think with Clojure's ability to make use of mutli cpu
> hardware it would be a good choice for high-end game development.

Clojure is not the only language which provides access to multiple
CPUs/cores.  When programming with immutable data structures, the code
is inherently parallelizable.  I don't imagine industry programmers
starting to write functional code (yes, there's a pun!) just to get
"easier" access to parallel processing.

> Does anyone know if big game studios like Electronic Arts are using or
> looking into Clojure for this purpose?

Never heard of any "major" game studios writing games in Java (except
mobile platforms).
EA is a publisher, not a producer.
--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Question about building modular code in Clojure

2009-05-22 Thread Mark Engelberg

On Wed, May 20, 2009 at 8:14 AM, Konrad Hinsen
 wrote:
> Here is another solution that I consider preferable to the use of
> load.

Konrad, this is an interesting approach, and it does feel like a
better way to organize similar modules than using load.

However, there seems to be one way that this solution falls short of
the load-and-redefine technique.  Imagine if, in the example above,
the function that you want to set up for extension is
print-grav-stats.  I don't think that will work with your method
because print-grav-stats refers to variables that would not be in
scope when the macro expands.  If there were a way to declare all the
variables in the body of the macro BEFORE the let, and then the
definitions, I think that might fix it, but I'm not totally sure how
to do that.

If you don't have side effects in forms, you can simply execute the
forms before the let, thus ensuring all vars are in scope.  I think
just changing expansion to:
(list (list 'quote (cons 'do forms))
   (list 'list (list 'quote `symbol-macrolet) param-map
   (list 'quote (cons 'do forms
would do the trick.

Not sure what to do to handle forms with side effects.

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Podcast mentioning Clojure

2009-05-22 Thread Konrad Hinsen

The following podcast (from "IEEE Internet Computing") about  
functional programming for the Web is a nice introduction to the  
advantages of functional programming, and it does mention Clojure:

http://www2.computer.org/portal/web/computingnow/functionalweb

Those who have a hard time convincing their boss that Clojure is good  
for their work might be able to profit from it.

Konrad.

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Question about building modular code in Clojure

2009-05-22 Thread Konrad Hinsen

On 22.05.2009, at 10:03, Mark Engelberg wrote:

> However, there seems to be one way that this solution falls short of
> the load-and-redefine technique.

I don't think it can ever fall short of the load-and-redefine  
technique because you can emulate it completely (unless I overlooked  
something): you set up a template without any parameters. In that  
case, it will be introduced verbatim into the namespace where the  
template is used, and then you can redefine whatever you want. You  
still gain something compared to load-and-redefine: the template is  
an ordinary Clojure object residing in a namespace, so it works  
without any namespace trickeries and a template can even be used if  
its defining namespace has been aot-compiled and the original source  
code is not available.

Of course, I'd like to do even better than that and make  
parametrization of the template as clean as possible, so your  
counterexample is still relevant.

> Imagine if, in the example above, the function that you want to set  
> up for extension is
> print-grav-stats.  I don't think that will work with your method
> because print-grav-stats refers to variables that would not be in
> scope when the macro expands.

As long as it uses the same variables as the template, it would still  
work, but (like the load-and-redefine method) it would fail as soon  
as the template author decides to change the names of his variables.  
I suppose that to some extent such a risk is inevitable with any  
method based on textual replacement. C macros are famous for that  
kind of problem, and my templates work at pretty much the same level  
as C macros.

A well-defined template should define anything meant to be changed as  
template parameters, clearly state the symbols that the template  
itself inserts into the namespace, and use gensyms for anything else.  
My current version doesn't permit to define gensyms, but I think that  
could be added easily.  Of course, writing such a well-behaved  
template represents more effort than wrapping a piece of code in a  
(deftemplate ...) form.

> If there were a way to declare all the
> variables in the body of the macro BEFORE the let, and then the
> definitions, I think that might fix it, but I'm not totally sure how
> to do that.

What do you call "variables" here? All the symbols that are used  
inside the template expansion?

> If you don't have side effects in forms, you can simply execute the
> forms before the let, thus ensuring all vars are in scope.  I think
> just changing expansion to:
> (list (list 'quote (cons 'do forms))
>(list 'list (list 'quote `symbol-macrolet) param-map
>(list 'quote (cons 'do forms
> would do the trick.

I'd expect that executing before the let would lead to lots of  
"undefined symbol" errors.

Konrad.

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: La Clojure plugin for IntelliJ IDEA updated

2009-05-22 Thread Ilya Sergey
Vagif,

Of course, we have plans to support remoter REPL as well. For now you may
use `remote debug' run configuration type to connect to the appropriate
application port and debug it.

With best regards,
Ilya

2009/5/21 Vagif Verdi 

>
> Do you have plans to add connect/disconnect to existing running Repl
> over the network ?
> Emacs has this mode with slime and it is very handy in developing web
> applications.
>
> >
>

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Clojure for high-end game development

2009-05-22 Thread David Powell



On Fri 22/05/09 09:50 , "jdz" yohoho...@gmail.com sent:
> 
> On May 21, 9:35 pm, tcg  mail.com> wrote:> You would think with Clojure's ability to make
> use of mutli cpu> hardware it would be a good choice for high-end
> game development.
> Clojure is not the only language which provides access to multiple
> CPUs/cores.  When programming with immutable data structures, the code
> is inherently parallelizable.  I don't imagine industry programmers
> starting to write functional code (yes, there's a pun!) just to get
> "easier" access to parallel processing.
> 
> > Does anyone know if big game studios like
> Electronic Arts are using or> looking into Clojure for this
> purpose?
> Never heard of any "major" game studios writing games in Java
> (exceptmobile platforms).
> EA is a publisher, not a producer.

Not about clojure, but see this presentation from the developers of Gears of 
War:



It talks about the programming language features that they would like, that 
would enable them to utilise 
multi-cores, and write better software in general; functional programming and 
STM are the main two.

-- 
Dave



--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Bit-Shift without Sign-Extend?

2009-05-22 Thread David Powell



On Fri 22/05/09 03:39 , "CuppoJava" patrickli_2...@hotmail.com sent:
> 
> Hi everyone,
> I'm just wondering where the equivalent of the ">>>"
> operator is forClojure. I need it to do a divide-by-power-of-2 on unsigned 
> bytes.

Java doesn't have this either.  Its >>> operator doesn't work properly on 
bytes.  It promotes them to a 
signed int, then unsigned shifts them, then casts them back to a signed byte - 
leaving >>> behaving exactly 
the same as >>.

-- 
Dave


--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Question about building modular code in Clojure

2009-05-22 Thread Mark Engelberg

On Fri, May 22, 2009 at 1:37 AM, Konrad Hinsen
 wrote:
> As long as it uses the same variables as the template, it would still
> work, but (like the load-and-redefine method) it would fail as soon
> as the template author decides to change the names of his variables.
> I suppose that to some extent such a risk is inevitable with any
> method based on textual replacement. C macros are famous for that
> kind of problem, and my templates work at pretty much the same level
> as C macros.
>

I was thinking that if you have:
(def a 2)
(def b 3)
(defn f [] a)

and you set it up with your deftemplate macro where f is the thing
that is parameterized, then if you try to pass in a new value for f,
like:
(fn [] b), it macro expands to
(let [f (fn [] b)]
  (def a 2)
  (def b 3))
which clearly doesn't work.

So you need to pre-declare b, or get b into the namespace with some
means other than the template first.  And if you did that, it would
point at the "old b", which works fine in this case, but might fail
for more complex kinds of recursions where eventually the value of b
depends on a call to the parameterized function.

I see now that my suggestion to include all the defines before the let
would also fail badly.

I find it ironic that after years of eschewing objects, I'm
discovering that at the module level, I desperately want something
object-like.

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: La Clojure plugin for IntelliJ IDEA updated

2009-05-22 Thread Ilya Sergey
Hi Toni.

Unfortunately for now we don't have neither description of existing features
nor complete how-to manual. In fact some details look quite similar to Scala
support, which is described here:
http://www.jetbrains.net/confluence/display/SCA/Scala+Plugin+for+IntelliJ+IDEA
We're going to add such description for Clojure support in a few days.

With best regards,
Ilya

2009/5/20 Antoni Batchelli 

> Ilya, where can we find documentation about how to use the new features?
> ... the information on the plugin page is pretty scarce...
> Good job by the way!
>
> Toni.
>
> On May 20, 2009, at 12:00 PM, Ilya Sergey wrote:
>
> In last build of La Clojure plugin (thanks to Kurt Christensen) we added
> REPL integration with history and possibility to load files and evaluate
> expressions from the editor.
>
> With best regards,
> Ilya Sergey
>
> 2009/5/18 Ilya Sergey 
>
>> Hello, Asbjørn.
>>
>> For now IntelliJ support of Clojure is rather editor-oriented than
>> REPL-oriented. For now you may only run REPL on some of your files. REPL
>> History and other support is now under development and it will be added in
>> the next release.
>>
>> With best regards,
>> Ilya
>>
>> 2009/5/15 Asbjørn Bjørnstad 
>>
>> On May 14, 2:16 am, Ilya Sergey  wrote:
>>> > Hello, all.
>>> >
>>> > I'm happy to announce, that new build of the `La Clojure' plugin for
>>> > IntelliJ IDEA is uploaded into repository and may be downloaded
>>> directly
>>> > fromhttp://plugins.intellij.net/plugin/?id=4050or via IntelliJ plugin
>>> > manager. Among new features I may name code-aware resolve and
>>> completion
>>> > functionality for Java classes, packages and members as well as for
>>> Clojure
>>> > definitions and namespaces. By many request code indentation and
>>> alignment
>>> > is customizable now,
>>> > In near-ter future plans are cross-language compilation with Java and
>>> > multiple editor actions.
>>>
>>> Hi, I'm a emacs guy, but checked out intellij/La Clojure last night.
>>> I may have missed it, but is there a way to compile/eval one form from
>>> the editor into a running REPL? That and a command-line history a.la.
>>> readline in the REPL what I'm missing from my current workflow.
>>>
>>> Also, is there a discussion forum for users of the plugin somewhere?
>>> --
>>>  -asbjxrn
>>
>>
>>
>
>
>
>
>
> >
>

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Clojure at JavaOne

2009-05-22 Thread David Powell



On Thu 21/05/09 17:43 , "Rich Hickey" richhic...@gmail.com sent:
> 
> I'd like to do something modest but distinguishing. I have a vague
> notion of showing some Clojure data originating in some XML off the
> web, being passed to some filtering/walking code, getting displayed,
> stored in a DB, all without specific DOM/model/recordset APIs, a
> couple of lines for each task. This demonstrating the difference of
> not being OO - using generic abstract data types like maps everywhere.

I think something like this is a good idea.  It is very practical.

I can't share the code, but I am doing something similar - using clojure to 
build a pipeline that takes 
different shaped queries as resultset-seqs, clusters related records into 
groups, and pushes the groups 
through the pipeline using lazy-seq.  I can also swap in literal datastructures 
in order to test the code 
without depending on the database.

I guess there are lots of datasources that you could do something similar to 
resultset-seq with.  Atom feeds 
(particularly ones with history rel=next links), OpenSearch query results, 
queries to non-relational data-
stores, XMPP events...



--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Clojure as a Java lib documentation / examples?

2009-05-22 Thread David Powell



On Fri 22/05/09 02:23 , Brett Morgan brett.mor...@gmail.com sent:
> 
> Hi guys,
> 
> I have some evil thoughts of using Clojure as a java library so that i
> can use both the STM and the persistent data structures in projects
> that my team of java developers can work with.
> 
> As much as I'd like to get the team coding in Clojure properly, I have
> enough trouble selling the idea of using immutable data structures. If
> I hide the clojure magic behind interfaces, I can have the team coding
> in plain java, and wrap what they do in clojure transactions and what
> not. I'd like to do this in a way that the clojure repl can still be
> used to interact with the running server.
> 
> So where do I start reading? =)

The TransactionalHashMap class in clojure is a class that has really been 
designed to be used from Java.  You 
need to use it in conjunction with LockingTransaction.runInTransaction().

-- 
Dave


--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Question about building modular code in Clojure

2009-05-22 Thread Konrad Hinsen

On 22.05.2009, at 11:01, Mark Engelberg wrote:

> I was thinking that if you have:
> (def a 2)
> (def b 3)
> (defn f [] a)
>
> and you set it up with your deftemplate macro where f is the thing
> that is parameterized, then if you try to pass in a new value for f,
> like:
> (fn [] b), it macro expands to
> (let [f (fn [] b)]
>   (def a 2)
>   (def b 3))
> which clearly doesn't work.

Templates do nothing but symbol remplacement, so if you specify f as  
a template parameter and pass in (fn [] b) as its value, you get

(defn (fn [] b) [] a)

If you want to be able to pass in a function object, you'd have to  
write your template as

(deftemplate my-template [function]
(def a 2)
(def b 3)
(def f function))

If you want to redefine the function f given in the template, you'd  
just write the new definition after the template expansion.

> I find it ironic that after years of eschewing objects, I'm
> discovering that at the module level, I desperately want something
> object-like.

You have very much the same problems using objects. You can add and  
override methods and attributes, but you still have to refer to  
existing attributes and methods by the names defined in the original  
class. You also have to be careful not to use these names again for a  
different purpose. With templates, you have to know the symbols used  
in specific places in order to be able to refer to them and to avoid  
overwriting them. The restrictions and conditions are thus very similar.

Konrad.


--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Clojure at JavaOne

2009-05-22 Thread Rich Hickey



On May 21, 11:38 pm, Adrian Cuthbertson 
wrote:
> >... impact part can be merged with the "business application" mindset by
> >generating a report that includes the data visualization (I think PDF
> >generation is built into processing).
>
> I've been doing some work with enlive and XHtmlRenderer - it's a
> pretty awesome way of generating (business, media, etc)  PDF docs from
> html templates, css style sheets and clojure generated data. I could
> post some examples if there's any interest.
>

Sure, please do.

Rich

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Clojure at JavaOne

2009-05-22 Thread Rich Hickey



On May 22, 7:16 am, Rich Hickey  wrote:
> On May 21, 11:38 pm, Adrian Cuthbertson 
> wrote:
>
> > >... impact part can be merged with the "business application" mindset by
> > >generating a report that includes the data visualization (I think PDF
> > >generation is built into processing).
>
> > I've been doing some work with enlive and XHtmlRenderer - it's a
> > pretty awesome way of generating (business, media, etc)  PDF docs from
> > html templates, css style sheets and clojure generated data. I could
> > post some examples if there's any interest.
>
> Sure, please do.
>


Actually, let me extend that invitation  - if anyone's got a small
(one-page-ish) Clojure program that does something interesting, and
are willing to have it demonstrated at JavaOne, please paste it
somewhere and post a note here.

Thanks,

Rich
--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Clojure at JavaOne

2009-05-22 Thread Mark Derricutt
I did something similar the other week:

http://www.talios.com/connecting_the_clouds__the_internet_in_new_zealand_in_pdf.htm

Using clj_web_crawler and XHtmlRenderer to make a PDF of a locally available
book (in wiki format) on the history of the New Zealand Internet.

On Fri, May 22, 2009 at 11:16 PM, Rich Hickey  wrote:

>
>
>
> On May 21, 11:38 pm, Adrian Cuthbertson 
> wrote:
> > >... impact part can be merged with the "business application" mindset by
> > >generating a report that includes the data visualization (I think PDF
> > >generation is built into processing).
> >
> > I've been doing some work with enlive and XHtmlRenderer - it's a
> > pretty awesome way of generating (business, media, etc)  PDF docs from
> > html templates, css style sheets and clojure generated data. I could
> > post some examples if there's any interest.
> >
>
> Sure, please do.
>
> Rich
>
> >
>

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Clojure at JavaOne

2009-05-22 Thread Brian Doyle
I have a one pagish program that you pass in your screen resolution and it
randomly picks out a new
desktop image from ftp.gnome.org, downloads the image and updates your
desktop.  This assumes
your using Gnome.

http://github.com/heyZeus/clojure-stuff/blob/0c81123fcb3dc4bafa0df94b6e32dc49729595d3/update-desktop-image.clj

On Fri, May 22, 2009 at 5:33 AM, Rich Hickey  wrote:

>
>
>
> On May 22, 7:16 am, Rich Hickey  wrote:
> > On May 21, 11:38 pm, Adrian Cuthbertson 
> > wrote:
> >
> > > >... impact part can be merged with the "business application" mindset
> by
> > > >generating a report that includes the data visualization (I think PDF
> > > >generation is built into processing).
> >
> > > I've been doing some work with enlive and XHtmlRenderer - it's a
> > > pretty awesome way of generating (business, media, etc)  PDF docs from
> > > html templates, css style sheets and clojure generated data. I could
> > > post some examples if there's any interest.
> >
> > Sure, please do.
> >
>
>
> Actually, let me extend that invitation  - if anyone's got a small
> (one-page-ish) Clojure program that does something interesting, and
> are willing to have it demonstrated at JavaOne, please paste it
> somewhere and post a note here.
>
> Thanks,
>
> Rich
> >
>

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Clojure to the rescue....

2009-05-22 Thread Luc Prefontaine
This Monday, I got a call from a friend who's working at a large US
company selling chips and scanners for id cards.
They are biding on a large contract for a foreign country and need to
provide printed samples in their
answer to this RFP. The deadline is next week.

The sample ids had to be printed in Europe and for some reason nobody
realized that the shop printing the ids
needed the data of the samples to be submitted using a custom XML input
format, oups !
The raw material was already in Europe this Monday.

My friend was desperate because of the delays and he was not able to
find someone within his company
to turn around on a dime to fix this. The shop printing the ids was
officially closed this Thursday and Friday.

I got the XML input specs from Europe at 3:30 am Tuesday and an Excel
spreadsheet with the data for the samples
a couple of hours later. We went back an forth with specifications from
US and Europe.
It was not just mapping the spreadsheet fields to an XML layout, some
XML fields had to be generated and encoded
to support OCR scanners.

Took 2 days to get a decent output from the printing process with
changes to the sample data, the field mapping, 

I wrote 119 Clojure code lines, I could probably rip of 20% to get more
compact but debugging was a primary concern
so I had lots of lets with local bindings to slice the marshaling and
trace intermediate results.

The real challenge was to work with people in a -6hrs time zone :)))

I made sure that every party involved got the code I wrote and got
acquainted with Clojure.
The interactive nature of Clojure and the compactness of the code made
all the difference in
the turn around between spec updates and spiting out an updated XML
input.

Clojure saved the day for this company :

Now I can get back to more serious stuff on our product. 

Luc Préfontaine

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Clojure for high-end game development

2009-05-22 Thread Daniel Lyons


On May 21, 2009, at 12:35 PM, tcg wrote:

> Does anyone know if big game studios like Electronic Arts are using or
> looking into Clojure for this purpose?


Apparently one company wrote some games in Lisp (Jak and Daxter): 
http://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp

Who knows? It could happen.

—
Daniel Lyons
http://www.storytotell.org -- Tell It!


--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Clojure for high-end game development

2009-05-22 Thread Ian Phillips

> You would think with Clojure's ability to make use of mutli cpu
> hardware it would be a good choice for high-end game development.
>
> Does anyone know if big game studios like Electronic Arts are using or
> looking into Clojure for this purpose?


It's unlikely to be used in a core game engine, even Java is no good
there as these guys need pretty low-level access to the hardware
(there's no way in Java to write your own custom allocator, or use
different allocators for different classes, for example).

But for higher level/scripting type stuff, it could definitely happen,
as far as I can tell the most popular language for game scripting at
the moment is Lua, but there are a huge number of custom
'little-languages' that ship with various engines.

And, of course, for multiplayer stuff Clojure would be a superb choice
for writing the server side in.

Cheers,
Ian.

#ifndef __COMMON_SENSE__  | Ian Phillips
#include  | i...@ianp.org
#endif| http://ianp.org/


--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Clojure for high-end game development

2009-05-22 Thread Jeff Heon

> EA is a publisher, not a producer.

And they did publish the videogame Abuse, which is made from a list
variant:
http://en.wikipedia.org/wiki/Abuse_(computer_game)

Interestingly, there is a thread about video game programming using
Lisp here:
http://news.ycombinator.com/item?id=516778

And the first comment mentions Clojure 8)

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Bit-Shift without Sign-Extend?

2009-05-22 Thread CuppoJava

Wow that's news to me...
I thought this was a fairly standard operator. I'm surprised that Java
doesn't have a correct version of it.
--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



compilation and classpath

2009-05-22 Thread tsuraan

I'm having some trouble getting clojure to generate .class files.  I
have a directory layout like this:

test/
main.clj

where main.clj is the same file as from
http://clojure.org/compilation, but with the 'clojure.examples.hello
replaced with 'test.main .  I've tried running clojure a few different
ways:

from the parent dir of the test dir, as java -cp
~/src/clojure/clojure.jar:`pwd`/ clojure.main
from within the test dir, as java -cp ~/src/clojure/clojure.jar:`pwd`/..

In both cases, I can successfully (use 'test.main) and call (-main
"foo"), and it works, but when I try to call (compile 'test.main) I
get java.io.IOException: No such file or directory (main.clj:1).  What
do I need to do to get compilation to work?

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Bit-Shift without Sign-Extend?

2009-05-22 Thread Michael Wood

On Fri, May 22, 2009 at 5:17 PM, CuppoJava  wrote:
>
> Wow that's news to me...
> I thought this was a fairly standard operator. I'm surprised that Java
> doesn't have a correct version of it.

I think the problem is that Java does not have unsigned bytes (or
other integer types).

e.g. see here:
http://www.jguru.com/faq/view.jsp?EID=13647
http://darksleep.com/player/JavaAndUnsignedTypes.html

-- 
Michael Wood 

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: compilation and classpath

2009-05-22 Thread Christopher Wilson

You probably need to set (and create!) the correct compilation
(output) directory. This defaults to a "classes" directory as a
subdirectory of your current working directory. So if you had:

test/main.clj

you'd need

classes/

also make sure that this directory is on your classpath. I think this
is what I needed to do to get everything working.

--
Chris

On Fri, May 22, 2009 at 10:34 AM, tsuraan  wrote:
>
> I'm having some trouble getting clojure to generate .class files.  I
> have a directory layout like this:
>
> test/
>    main.clj
>
> where main.clj is the same file as from
> http://clojure.org/compilation, but with the 'clojure.examples.hello
> replaced with 'test.main .  I've tried running clojure a few different
> ways:
>
> from the parent dir of the test dir, as java -cp
> ~/src/clojure/clojure.jar:`pwd`/ clojure.main
> from within the test dir, as java -cp ~/src/clojure/clojure.jar:`pwd`/..
>
> In both cases, I can successfully (use 'test.main) and call (-main
> "foo"), and it works, but when I try to call (compile 'test.main) I
> get java.io.IOException: No such file or directory (main.clj:1).  What
> do I need to do to get compilation to work?
>
> >
>



-- 
Chris Wilson 

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: compilation and classpath

2009-05-22 Thread tsuraan

> You probably need to set (and create!) the correct compilation
> (output) directory. This defaults to a "classes" directory as a
> subdirectory of your current working directory. So if you had:

And this worked!  Now that I'm looking for the *compile-path*
variable, I see that it's mentioned in the compilation page.  I guess
I skimmed a little too lightly :)

Thanks a ton!

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Bit-Shift without Sign-Extend?

2009-05-22 Thread Vincent Foley

Like other mentioned in the thread, Java has neither the >>> operator,
nor unsigned data types.

With that said, I think the function you are looking for is bit-shift-
right:

user> (bit-shift-right 2r1110 1)
7

I hope this helps.

Vincent.

On May 21, 9:39 pm, CuppoJava  wrote:
> Hi everyone,
> I'm just wondering where the equivalent of the ">>>" operator is for
> Clojure. I need it to do a divide-by-power-of-2 on unsigned bytes.
>   -Patrick
--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: compilation and classpath

2009-05-22 Thread Mark Engelberg

I also had lots of problems getting compilation to work.  I think
perhaps Clojure is making some assumptions about where your working
directory is located relative to your clojure.jar and classpath, and
if you have a different directory structure, things fail.  For me, the
solution was to explicitly set the *compile-path* variable.

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Bay Area Clojure User Group meeting in SF during JavaOne (6/3) with Rich Hickey

2009-05-22 Thread Tom Faulhaber

We're very excited to announce a Bay Area Clojure User Group meeting
in San Francisco with special guest Rich Hickey.

The meeting will be Wed. June 3 @ 5:30PM. This is during the JavaOne
conference and we hope that all Clojurians (and those interested in
Clojure) who find themselves in SF for the conference will come join
us.

We'll be just a few blocks from the Moscone convention center in the
SOMA neighborhood  of San Francisco, so it's easy for everyone in the
city (or nearby) to attend.

Details on the meeting are on the meetup site here:
http://www.meetup.com/The-Bay-Area-Clojure-User-Group/calendar/10417495/

We're going to try a little bit different format, which we think will
be fun. We'll start with a set of short (~10min) presentations on
various works-in-progress using Clojure. Following that, we'll have a
town-hall style discussion with Rich Hickey on subjects that interest
the participants.

If anyone has some work they'd like to present to a great audience,
please let me (tom -at- infolace -dot- com) or Amit Rathore
(amitrathore -at- gmail -dot- com) know and we'll get you on the
agenda.

IMPORTANT NOTE: Due to building security, you *must* RSVP so that
security has your name at the front desk. RSVP on the meetup site or
email/call me (at 415-786-2709) to let us know.

This one should be fun!

Tom Faulhaber

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Clojure at JavaOne

2009-05-22 Thread Christophe Grand

Rich Hickey a écrit :
> Actually, let me extend that invitation  - if anyone's got a small
> (one-page-ish) Clojure program that does something interesting, and
> are willing to have it demonstrated at JavaOne, please paste it
> somewhere and post a note here.
>   

I'm dabbling with a quick and dirty IRC logger + HTTP server, maybe too 
long (60 lines)
http://gist.github.com/116323

-- 
Professional: http://cgrand.net/ (fr)
On Clojure: http://clj-me.blogspot.com/ (en)



--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Question about building modular code in Clojure

2009-05-22 Thread Mark Engelberg

OK, after looking at deftemplate with macroexpand, it's starting to
make more sense.  I suppose one downside to this versus load is that
it's probably much more difficult to debug (just because all your code
is wrapped in a macro), but basically I like the idea.

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Question about indentation in emacs.

2009-05-22 Thread pj

Greetings.

This is more of emacs question than Clojure question.

I am trying to figure out how to change emacs Clojure mode's default
indentation behaviour.

By default, emacs is indenting my code like this:

(defn calendar-initial-sync [server user mailfile password formula]
  (with-session session hostname username password
  (with-open-db session db dbname
  (with-search-results db docs
formula
 
(foreach-note docs doc


I would like it to indent like this:

(defn calendar-initial-sync [server user mailfile password formula]
  (with-session session hostname username password
(with-open-db session db dbname
  (with-search-results db docs formula
(foreach-note docs doc

Could someone help me figure out how to do this?

thanks
pj

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Question about indentation in emacs.

2009-05-22 Thread Phil Hagelberg

pj  writes:

> I would like it to indent like this:
>
> (defn calendar-initial-sync [server user mailfile password formula]
>   (with-session session hostname username password
> (with-open-db session db dbname
>   (with-search-results db docs formula
> (foreach-note docs doc
>
> Could someone help me figure out how to do this?

You have to teach Emacs that the with-* forms are macros that need
special indenting. You can do this using this snippet of elisp:

(define-clojure-indent (with-session 1)
   (with-open-db 1)
   (with-search-results 1))

Two caveats.

Unfortunately I still haven't figured out a way to get these indentation
rules to "travel with" the project; each person hacking on the project
will have to manually add them to his own personal config. Project-wide
settings files only work for setting variables, since evaluating arbitrary
code snippets just by opening a file is obviously a security
disaster. So toss them in the readme.

Emacs will only recognize literal calls to "with-session" etc. If you
qualify it by a namespace you will have to add the qualified identifier
as a separate indentation rule. Theoretically this could be hooked up to
the running Clojure instance to recognize macro calls with an arg list
that ended in & body, but I'm not sure it's worth the trouble.

-Phil

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Clojure for high-end game development

2009-05-22 Thread Brian Sletten

Most game development is obviously still done w/ C++, even for backend  
services which just astounds me. At best, some developers might be  
using Tomcat for community sites and whatnot.  The tide is probably  
starting to turn, but there's not a lot of Clojure just yet.

At Riot (http://riotgames.com), we are doing quite a bit on the  
backend with Enterprise Java, XMPP, data grid clusters, etc. for the  
League of Legends (http://leagueoflegends.com) platform.

We are obviously aware of and interested in Clojure and Scala as well  
as environments like NetKernel for their ability to leverage multiple  
CPUs, but that would still be for infrastructure. As was mentioned  
elsewhere Lua is used as the scripting language of choice for many  
modern games. There are pockets of Lisp but I don't think it is too  
widespread.

It's still going to be awhile until any serious games leverage a  
modern language like Clojure.

On May 21, 2009, at 2:35 PM, tcg wrote:

>
> You would think with Clojure's ability to make use of mutli cpu
> hardware it would be a good choice for high-end game development.
>
> Does anyone know if big game studios like Electronic Arts are using or
> looking into Clojure for this purpose?
>
> >


--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Var binding and lazy structures behavior (bug?)

2009-05-22 Thread Josip Gracin

Hi!

I'm getting unexpected behavior trying to use binding and map.  Here's
what happens.

(def *v*)
(defn fun [i] *v*)
(defn bv []
  (binding [*v* 100]
(map fun [1 2])))

Evaluating (bv) throws "Var *v* is unbound exception".  I expected it
to return (100 100).

Using the released Clojure 1.0.0-

Is this a bug?

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---