Arc Forumnew | comments | leaders | submit | dido's commentslogin
4 points by dido 4886 days ago | link | parent | on: Arcueid, a C implementation of Arc

I've finally managed to fix most of the problems with the initial release and at last arc.arc now loads cleanly. Am in the process of testing each of the functions and macros in arc.arc to see if they work as expected. Now it seems that Arcueid is getting that much closer to being complete!

New in version 0.0.2:

- Readline support in the REPL. Note that you'll need the development headers for readline (libreadline-dev on Ubuntu) for this to work. This is also the reason why the REPL is GPLed instead of LGPLed.

- All of the Arc definitions are there, though they've not all been tested and they likely don't all work.

- Tracing and disassembly. There is a (trace) function that toggles tracing. Everything run on the REPL becomes traced until it returns. (disasm <somefun>) will disassemble a function and show its bytecode definition.

It's tagged v0.0.2 and is commit 602da1f00f7937e0fcf57c71b376673c5aab3ad6

-----

1 point by dido 4889 days ago | link | parent | on: Arcueid, a C implementation of Arc

Do a git pull. Oops, some debugging code I was using temporarily made it into the repo. Will try to ensure this doesn't happen again. Last commit should be: fdeb76087b48ff19d9f2666d05a4429ac4145b24

-----

1 point by rocketnia 4889 days ago | link

Okay, that helps a lot.

  $ git pull
  (...)
  $ ./configure
  (...)
  $ make
  (...)
  $ make install
  (...)
  /usr/bin/install: cannot create regular file `/usr/local/lib/libarcueid.so.0.0.0': Permission denied
  (...)
  $ sudo make install
  (...)
  $ arcueid
  arcueid: error while loading shared libraries: libarcueid.so.0: cannot open shared object file: No such file or directory
  $ src/arcueid
  arc> (+ 1 4)
  5
  arc> ^C
  $
What do you think about that error? I don't see anything obviously amiss, but then I don't know what to look for. ^_^;

  $ which arcueid
  /usr/local/bin/arcueid
  $ ls /usr/local/lib | grep arcueid
  libarcueid.a
  libarcueid.la
  libarcueid.so
  libarcueid.so.0
  libarcueid.so.0.0.0
  $ git log
  commit fdeb76087b48ff19d9f2666d05a4429ac4145b24
  (...)

-----

3 points by dido 4889 days ago | link

Try adding the single line

  /usr/local/lib
to the end of /etc/ld.so.conf and then run ldconfig -v. This is a frequent issue when it comes to shared libraries that get installed in /usr/local/lib. I have no idea why most Linux distros don't like to put /usr/local/lib in ld.so.conf by default. It is extremely irritating, since most everything one builds from source installs there by default.

-----

1 point by rocketnia 4889 days ago | link

That works!

Interestingly, this is what /etc/ld.so.conf looked like before:

  include /etc/ld.so.conf.d/*.conf
And this was in /etc/ld.so.conf.d/libc.conf:

  # libc default configuration
  /usr/local/lib
The "include" line doesn't seem to do what it looks like it's supposed to do. :-p The man page for ldconfig doesn't mention "include" at all (nor #-comments...). It would be funny if Linux Mint came with this kind of ld.so.conf but its version of ldconfig thought "include" was just another directory in the list.

-----

1 point by dido 4890 days ago | link | parent | on: Arcueid, a C implementation of Arc

I'm a bit of an anime/manga/visual novel fan and one of my favorites is a show called Shingetsutan Tsukihime (Tsukihime, Lunar Legend). The main heroine is named Arcueid Brunestud and I thought the name was too good to pass up for this kind of project. I hope Type Moon doesn't give me problems over this later...

I haven't had a lot of time to work on it which is why it took so long. It's just a side project... In retrospect I probably should have announced it sooner but I wanted to have something a bit usable first.

I use Emacs org mode which is why the file arcueid.org is named as it is.

-----

1 point by akkartik 4890 days ago | link

Oh, so you did half-mean to send me to the URL! :)

How do I build the project? I sense I need to generate a configure script or Makefile somehow. I know what to do past that.

-----

2 points by dido 4890 days ago | link

You'll need the autotools installed (autoconf/automake/libtool). Do an autoreconf -i in the main project directory. This should generate a configure script from the configure.in and all of the automake and libtool stuff for it. From there it should be configure / make / make install the way it normally is. You can do configure --enable-unit-tests if you have GNU Check installed so that you can run the unit tests.

-----

1 point by akkartik 4890 days ago | link

I ran autoreconf -i, and then configure, and I ran into this error:

  ./configure: line 12048: syntax error near unexpected token `CHECK,'
  ./configure: line 12048: `  PKG_CHECK_MODULES(CHECK, check >= 0.9.4,'
So this means GNU check is not installed? It's not recognizing the PKG_CHECK_MODULES macro. Where can I install GNU check from? Googling found nothing.

-----

1 point by dido 4889 days ago | link

http://check.sourceforge.net/

It's the unit testing framework I'm using, and shouldn't be necessary in a tarball distribution (maybe I should make one soon...). The error looks like you also don't have pkg-config installed (http://www.freedesktop.org/wiki/Software/pkg-config).

All of these are readily available in the Debian / Ubuntu repositories. It has no dependencies that have to be built from source, at least on Debian/Ubuntu. Package name for check is just 'check' and pkg-config is just 'pkg-config'. What distro are you trying to build Arcueid under anyhow?

-----

1 point by akkartik 4889 days ago | link

I'm just using ubuntu. Lucid, I think. I installed check and pkg-config, no problems. But I still see the same error.

On a second machine I'm using linux mint which tracks the debian rolling release. There:

  $ ./configure
  ..
  checking gmp.h usability... no
  checking gmp.h presence... no
  checking for gmp.h... no
  configure: error: in `/home/akkartik/arcueid':
  configure: error: Bignum (libgmp) test failed (--disable-bignum to disable)
  See `config.log' for more details

  $ sudo apt-get install libgmp10
  libgmp10 is already the newest version.
Very weird.

-----

1 point by dido 4889 days ago | link

Have you got libgmp-dev installed? It cannot find the development headers which you'll obviously need to compile it. Anyhow, you can use --disable-bignum if that still doesn't help. If you're still having problems you can download a tarball of Arcueid 0.0.1 in the files section of the github page. That has a configure script so you ought to be able to ./configure && make && make install from there. I should try building the thing on a clean install of Ubuntu to fully identify all the dependencies for building straight from the cloned sources.

-----

1 point by akkartik 4889 days ago | link

Ah, installing libgmp-dev did it! Thanks.

Still unclear why ubuntu lucid is having trouble. It's a pretty vanilla server distro. I'll keep pottering with it, see what I can find out.

What do I do after building it? I tried running src/arcueid, both from the top-level dir, and from the arc dir. It segfaulted each time. Poking around with gdb now.. oh, do I have to make install before I can use it?

(I never realized how complex the makefiles get when you use autotools..)

-----

1 point by dido 4889 days ago | link

Well, the arcueid binary expects to find arc.arc in /usr/local/share/arcueid, and like I said there's practically no error handling. You can either do a make install (which should copy arc.arc to that place where the arc binary can find it), or you can run it as src/arcueid arc/arc.arc (explicitly specifying the path to arc.arc on the command line). Oh, and do a git pull!

-----

1 point by akkartik 4889 days ago | link

D'uh! I was stoopid. Yeah it works with the explicit path.

And yeah I did a git clone in the new laptop so it's all pulled.

Now that I have it running, how do I run the bootstrap compiler.arc?

-----

1 point by dido 4889 days ago | link

You don't, at least not for now. I found it faster to just write a version of the compiler in C using compiler.arc as a prototype (the fact that I've done this should be obvious by comparing compiler.c and compiler.arc). Seems there are a few more bugs in the compiler: the or macro seems to be expanding all wrong, and anything but nil crashes it. I need to take a closer look.

-----

1 point by dido 4889 days ago | link

Oh, and please do a git pull now before you do anything else. I've just managed to fix the bug that was preventing arc.arc from being loaded properly, although of course arc.arc makes reference to many global functions which still aren't defined in the core and will crash the interpreter. Next step will be to find these and implement them.

-----

1 point by akkartik 4890 days ago | link

How is arcueid pronounced?

-----

2 points by dido 4889 days ago | link

https://www.youtube.com/watch?v=GxH_B7DUbdg&t=3m21s

The guy with the glasses (Shiki Tohno) says her name at around 3:21. She's the blond girl with red eyes.

I think it's pronounced in the obvious way.

-----

2 points by rocketnia 4889 days ago | link

Thanks for that link, for a completely off-topic reason. That's one of the best examples of the golden W hamburger place I've seen. :-p http://www.baka-raptor.com/WcDonalds/index.php

-----

1 point by akkartik 4889 days ago | link

Ok, so like 'arquid'. Yeah it's a cool name.

-----

2 points by rocketnia 4889 days ago | link

I'd pronounce it like "R quay -d" or "arc weighed," not "R quid." Maybe that's already what you meant. :-p

-----

1 point by akkartik 4888 days ago | link

Ah, you're right. I had misheard.

-----

1 point by dido 5044 days ago | link | parent | on: possible bug involving len and nil?

Well, it might possibly be interpreted as 1 because the length of a symbol is 1, but this then raises the question as to why (len 'symbol) should not produce an error the way taking the len of other atoms does, e.g.:

  arc> (len 1)
  Error: "length: expects argument of type <proper list>; given 1"
  arc> (len 'symbol)
  1
The way I see it the most logical value for (len nil) is 0, that is if you want it to be the same as the empty list, and taking the len of any other symbol should produce an error.

-----

1 point by akkartik 5044 days ago | link

What arc are you using? On anarki and arc3.1 len.nil evaluates to 0.

Ah, I see rocketnia recently fixed it. Perhaps you just need to git pull?

http://github.com/nex3/arc/commit/9c0f4fb

-----

1 point by dido 5044 days ago | link

I just did a git pull on Anarki and indeed now (len nil) returns 0 as it should. However, (len 'sym) still returns 1, and I have to ask why this is so and not an error the way all other non-nil/string atomic values are.

-----

1 point by rocketnia 5044 days ago | link

Apparently Samuel Christie added it in order for Anarki's ppr.arc to work: https://github.com/nex3/arc/commit/fccf160fee607373ac15105e3...

I don't like len!sym being 1 either. I think ppr.arc is the thing that should be fixed, perhaps by having it use its own spinoff of 'len. But I didn't try to fix that; I just did the minimal change needed to get len.nil to work properly again.

It's kinda funny... I just noticed that both of my len.nil fixes (https://github.com/nex3/arc/commits/9c0f4fb2b54f4ceb11d0a2d2...) are currently living alongside each other, the older one just being dead code. :-p

-----

1 point by akkartik 5043 days ago | link

Perhaps he just wanted dotted lists to count the final element. I fixed that without breaking len!sym.

http://github.com/nex3/arc/commit/2d86c3

-----

1 point by dido 6270 days ago | link | parent | on: Moved Anarki to GitHub

Anyone got an invite for me? dido at imperium dot ph

-----

2 points by sacado 6270 days ago | link

Me. Hold on.

Edit : sent.

-----

1 point by dido 6270 days ago | link

Thanks.

-----

1 point by dido 6275 days ago | link | parent | on: Poll: Where are you from ?

Sino yung pangatlo?

-----

1 point by almkglor 6274 days ago | link

Hmm! Tatlo nga! Baka nagkamali lang ng pindot?

(translation, in case it's just someone who clicked the wrong country: dido: Who's the third? almkglor: Hmm! It is three! Maybe someone just clicked wrong?)

-----

1 point by dido 6275 days ago | link | parent | on: Poll: Where are you from ?

Where would you go? Kahit saan ka naman pumunta marami pa ring kalokohan. :p

-----

1 point by almkglor 6274 days ago | link

Hehe sa bagay maraming pinoy eh ^^

-----


I wonder if some of the work in optimizing Self, such as polymorphic inline caches [1] might be applicable for non-object oriented dynamically-typed languages such as Arc.

[1] http://research.sun.com/self/papers/pics.html

-----

1 point by dido 6284 days ago | link | parent | on: Handling dotted lists

It's supposed to be a predicate for a non-nil atom. I just realize that could better be written as (~acons current) instead, given that (acons nil) is also nil.

-----

2 points by eds 6283 days ago | link

I was confused because (~no current) is just the same as current by itself, and I didn't realize you wanted to test for non-nil atoms. Obviously (~no current) isn't what you want, because it returns true for lists.

  arc> (~no nil)
  nil
  arc> (~no 'a)
  t
  arc> (~no '(1 2 3))
  t
But I don't think (~acons current) does what you want either. Because (acons nil) is nil, (~acons nil) is true.

  arc> (~acons nil)
  t
  arc> (~acons 'a)
  t
  arc> (~acons '(1 2 3))
  nil
I think (~alist current) returns true for non-nil atoms, because (alist nil) is true.

  arc> (~alist nil)
  nil
  arc> (~alist 'a)
  t
  arc> (~alist '(1 2 3))
  nil

-----


Ruby is what pays the bills right now, but as CTO of my own company I've got to always be looking to the future. I bet the company's development on Ruby back in 2002 when the company was founded, and my intuition served us well. Now, I'm betting that Arc or a language like it might well be the cutting edge within the next five years.

-----

More