Arc Forumnew | comments | leaders | submitlogin
2 points by cthammett 3238 days ago | link | parent

Thanks for the tips, I'll keep on exploring the possibilities. On a side note, is there a c or python ffi for Anarki?


2 points by akkartik 3237 days ago | link

In the past I just used the Racket FFI for C with anarki's $ operator.

Hold on, let me throw up this arc project of mine from many years ago. The FFI isn't on head, but here's how I imported a Porter stemming (https://en.wikipedia.org/wiki/Stemming) implementation and a keyword-guessing algorithm in C: https://github.com/akkartik/readwarp/blob/e281ecfefd/keyword.... C functions that that invokes: https://github.com/akkartik/readwarp/blob/e281ecfefd/keyword...

(There's a password for my mail delivery service in that repo, but that account is now defunct. Hopefully nothing else is confidential. Please be nice and let me know if you see something there that might damage me :)

-----

2 points by cthammett 3235 days ago | link

Thanks, I didn't see anything suspect. It should be a good learning experience calling c from Anarki. I saw a tutorial today how to create c callable functions using NASM x86-64 assembly code and it worked. Do you think assembly and Anarki can talk to each other through c?

-----

1 point by akkartik 3235 days ago | link

No reason they couldn't!

If you're into assembly I'd love to hear what you think of my current project to teach programming using a sort of idealized assembly: http://github.com/akkartik/mu. I'm co-designing the assembly language with the OS around it, in the spirit of C+unix.

-----

2 points by cthammett 3234 days ago | link

The project looks interesting. I would like to learn more about assembly to, have greater understanding and control over what my computer actually does. All the tests passed but I made mu crash using repl.mu, if this help in finding bugs?

  ./mu repl.mu
  ready! type in an instruction, then hit enter. ctrl-d exits.
  (+ 1 1)
  missing type in {name: "1", properties: ["1": ]}
  mu: 041name.cc:82 bool disqualified(reagent&): Assertion `!x.types.empty()' failed.
  Aborted (Core dumped)
Also my left, middle and right mouse button clicks were printing rubbish to the terminal after that. I restarted the terminal and mouse functionality was normal again.

-----

2 points by akkartik 3233 days ago | link

Thanks for trying it! It's not actually a Lisp :) Check out the examples in the readme.

The repl is sadly not done. Repl feels like the wrong metaphor. I'm writing on a more useful version in edit.mu, but that's far from done. For now sadly you have to type code into a file and run it as a separate step. Just for a couple more weeks, hopefully.

-----

2 points by cthammett 3233 days ago | link

Impressive project, how long have you been programming for? I'm not sure if I can be of much technical assistance but if you recommend a few tools I could probably learn more about testing and find bugs. Earlier this week I installed valgrind to check for errors and memory leaks and I'm looking for a debugger that will work with lubuntu. I am also learning assembly.

-----

1 point by akkartik 3233 days ago | link

I'm starting to feel old :) I've been programming for 16 years now.

Feel free to ask me more questions. I'm not looking for help, rather to help. But there's still some way to go. In the meantime I'll help in any other way. Valgrind is super useful for C programming.

-----