• Content count

  • Joined

  • Last visited

Everything posted by marijnh

  1. Also, if you have an academic library near you you could see if they have the journals with articles in question there -- they'll often let you read or copy them for free.
  2. Loading unicode text files

    It would probably help if you knew which encoding your file uses. Read these: Once you (globally) understand what you are trying to do, I'm sure you can find a library that does it for you (though writing your own unicode-reading lib can be entertaining too).
  3. more scheme questions

    The first one just requires you to do (cons (cons ...) ...). The second is probably easier to solve with recursion than with list comprehension, but it is possible both ways. Apply (lambda (x) (* 5 x)) to (1 .. n) and then sum the result.
  4. Quote:Original post by Extrarius I just want to learn about what 'should' be thought about when designing a language to avoid common mistakes and to take advantage. How many programming languages do you know? Learning a few very different languages is a good way to get an overview of what works and what doesn't.
  5. Quote:Original post by Trap C++ 2.7s java -server 3.6s C++ CLR 5.5s java -Xint 50s clisp 144s yours would be around 160s (60 times slower than c++) What exactly are you measuring here? The really fast times for C++ surprise me. I tried printing out the first 40 fibonacci numbers, using the function shown to calculate each one separately, and I get less huge differences: C++: 19 sec Steel Bank Common Lisp: 34 sec (not a VM, I know) Edit: Oh I see. I tried CLisp... and let's just say that if it continues at this rate it will probably be done in 20 minutes or so :P I guess you just calculated less numbers in your tests, or you have a really fast computer.
  6. Because your VM does not have indirect adressing (i.e. write/read from basepointer+4 in one instruction) you already need more instructions than the equivalent intel-processor program. (But that shouldn't give such a huge difference) Also, is the C-version of the algorithm implemented equally inefficiently? (Recursive, instead of just looping)
  7. That is quite close to the hardware instruction set. How are you implementing the VM? (Especially the way you select code for an instruction, and the way your stack works) You could try looking at the assembly that the compiler generates for it - and even count instructions there.
  8. Your virtual instructions are probably a bit more high-level than the machine's instructions (unless you modelled your instruction set after machine instructions, which is usually not a very good idea), so the deduction that there are 80 machine instructions executed per VM instruction is probably false. Can you give us an idea of what kind of virtual instructions you use? That would probably lead to more useful comments.
  9. (or just use the DO macro, which is part of the language and pretty much a generalized C for loop) Also: Quote:Original post by flangazor Also, in my experience, emacs tabbed code that gets an ugly distance horizontally can almost certainly be refactored into something cleaner (and left oriented). Can you give some examples of this? The field where I get the most ugly wide code is usually when I try to define internal functions in a function (flet or labels in CL) - I often end up just making helper functions top-level to avoid this, but it would be nice to be able to have the code itself indicate "this is just an internal helper function!".
  10. How many entrants?

    Half of them will probably fail to make the deadline. I better get back to work myself!
  11. Timezone paranoia

    According to 23:59:00 Monday October 31, 2005 in EST converts to 04:59:00 Tuesday November 1, 2005 in GMT I'll probably be joining you in the last-second, tuesday night submitting :P
  12. Blender Python: Transformed vertices?

    My solution is to just select everything and apply the rotation and scaling with ctrl-A before exporting it (adding the translation to the vertices during the exporting). Depening on what you are trying to do this may not be a workable solution though.
  13. If it looks like the AI code is doing lots of things that it should not be doing (iterating through a set of all game objects for example), it might help to have your Game object provide certain services that will be needed by the AI code - for example getting nearby object, checking whether there is a clear path between two points, etc. It might be a good idea to put this functionality into a different class that contains a pointer to the Game object, to prevent cluttering your Game class with this stuff.
  14. I thought I put on the sarcasm pretty thick in my previous message :P Anyway, you claim that network & parser programming is 'of vital importance'. I disagree. Unless you want to do uncommon stuff, or just want to learn about these subjects, it is enough to have a basic understanding of them and a good library that handles them for you. Just like you do not need to write your own renderer to write a 3d application, you do not need to write you own low-level networking code to write a networked application.
  15. Oh god forbid people do not code every single detail by hand. Network & interface programming is so much fun that it would be a real shame, using a tool built exactly for what you want to do instead of programming it all in plain C. Now I do not have experience with MUD tools, but the text-adventure tools mentioned in the first post leave you free to get as creative as you want, while providing a convenient framework which saves you a lot of time & work. I suspect there are MUD tools that do the same.
  16. Looking for Non-GPL Lisp/Scheme

    If you are talking about Schelog - they use some kind of old, no-longer-standard macro system. The newest version supports these macros, and Schelog seemed to work as well after I added them.
  17. Looking for Non-GPL Lisp/Scheme

    Version .47 (here) should be more VC-friendly. More feedback always welcome (marijn at haverbeke dot nl).
  18. Looking for Non-GPL Lisp/Scheme

    Oh yes, I forgot about the 'and'/'or' thing. Maybe I'll just change them to && and || so I can stop worrying about that nonsense. The current memory manager is quite fast... only it is a pain to use because it moves stuff. I've been thinking about another approach but I doubt I'll be motivated enough to implement that anytime soon. I'll release a new version in a few weeks. But first I have a vacation coming up :P .
  19. Looking for Non-GPL Lisp/Scheme

    Woops, INIT_FILE and VERSION are defined in the makefile. I guess I should add something about them to the readme for people in non-unix environments. I have no idea what iso646.h does, what goes wrong when you do not include it? The std::isalpha thing is MS not conforming to standards it seems, so I'm not going to worry about that.
  20. Looking for Non-GPL Lisp/Scheme

    I forgot about this thread, so thank you roboguy for pointing out that Unlikely Scheme *does* have call/cc. It is a complete implementation of the 5th Revised Report. Edit: If you end up using this feel free to complain about bugs and such. So far the only testing has been running some special scripts designed for testing Scheme implementations and doing some small programs for myself with it. Another edit: 5th, not 4th report! [Edited by - marijnh on August 21, 2005 12:32:08 PM]
  21. Looking for Non-GPL Lisp/Scheme

    Tiny scheme is very primitive though, even my own Unlikely Scheme is more user friendly (and faster). (It uses the zlib (very free) license, but I can not guarantee there are no bugs left.)
  22. OpenGL OpenGL smooth animation

    Check the maximum delay between two frames. I suppose that 800 fps is averaged over some time. If some frames take a lot more time than others you get a choppy effect.
  23. Rotation (dumb problem)

    Allright, that should be good enough. Are you absolutely positively sure that swapping the two lines "glRotatef(aimer, 0.0f, 0.0f, 1.0f);" and "glTranslatef(-9.0f, -26.0f, 0.0f);" in the code you posted does not fix this?
  24. Rotation (dumb problem)

    What kind of coordinates does DrawGun() use for it's vertices? It just makes a rectangle around (0, 0), right?
  25. Rotation (dumb problem)

    First translate, then rotate.