Renamed the whole project from Grendel (Beowulf's opponent) to Naegling (Beowulf's sword).

This commit is contained in:
Simon Brooke 2026-04-12 13:13:10 +01:00
parent 69d762645a
commit 114c64501a
10 changed files with 65 additions and 21 deletions

View file

@ -1,6 +1,6 @@
PROJECT_ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
OBJS = grendel.o
OBJS = naegling.o
ifeq ($(BUILD_MODE),debug)
CFLAGS += -g -O0
@ -9,17 +9,17 @@ else ifeq ($(BUILD_MODE),run)
else ifeq ($(BUILD_MODE),profile)
CFLAGS += -g -pg -fprofile-arcs -ftest-coverage
LDFLAGS += -pg -fprofile-arcs -ftest-coverage
EXTRA_CLEAN += grendel.gcda grendel.gcno $(PROJECT_ROOT)gmon.out
EXTRA_CMDS = rm -rf grendel.gcda
EXTRA_CLEAN += naegling.gcda naegling.gcno $(PROJECT_ROOT)gmon.out
EXTRA_CMDS = rm -rf naegling.gcda
else
$(error Build mode $(BUILD_MODE) not supported by this Makefile)
endif
SRC_DIR=$(PROJECT_ROOT)/src/c
all: grendel
all: naegling
grendel: $(OBJS)
naegling: $(OBJS)
$(CXX) $(LDFLAGS) -o $@ $^
$(EXTRA_CMDS)
@ -30,4 +30,4 @@ grendel: $(OBJS)
$(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
clean:
rm -fr grendel $(OBJS) $(EXTRA_CLEAN)
rm -fr naegling $(OBJS) $(EXTRA_CLEAN)

View file

@ -1,6 +1,6 @@
# grendel
# naegling
A reimplementation of [Beowulf](https://git.journeyman.cc/simon/beowulf) bootstrapped in C, with a compiler following, basically, [Abdulaziz Ghuloum's recipe](https://bernsteinbear.com/assets/img/11-ghuloum.pdf).
A compiler for [Beowulf](https://git.journeyman.cc/simon/beowulf) following, basically, [Abdulaziz Ghuloum's recipe](https://bernsteinbear.com/assets/img/11-ghuloum.pdf) and [Noah Zentzis' implementation thereof](https://generalproblem.net/lets_build_a_compiler/).
## Memory model

View file

@ -1,7 +1,7 @@
/**
* day1.c
*
* Grendel: a compiling Beowulf reimplementation.
* Naegling: a compiling Beowulf reimplementation.
*
* Day 1 of work towards a compiler... eventually...
*

View file

@ -1,7 +1,7 @@
/**
* error.c
*
* Grendel: a compiling Beowulf reimplementation.
* Naegling: a compiling Beowulf reimplementation.
*
* The error handling subsystem.
*

View file

@ -1,7 +1,7 @@
/**
* error.h
*
* Grendel: a compiling Beowulf reimplementation.
* Naegling: a compiling Beowulf reimplementation.
*
* The error handling subsystem.
*
@ -13,8 +13,8 @@
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __grendel_error_h
#define __grendel_error_h
#ifndef __naegling_error_h
#define __naegling_error_h
#include <stdint.h>

View file

@ -1,7 +1,7 @@
/**
* lisp.c
*
* Grendel: a compiling Beowulf reimplementation.
* Naegling: a compiling Beowulf reimplementation.
*
* The compiler... eventually..
*

View file

@ -1,7 +1,7 @@
/**
* memory.h
*
* Grendel: a compiling Beowulf reimplementation.
* Naegling: a compiling Beowulf reimplementation.
*
* The memory management subsystem.
*
@ -9,8 +9,8 @@
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __grendel_memory_h
#define __grendel_memory_h
#ifndef __naegling_memory_h
#define __naegling_memory_h
#include <stdint.h>

44
src/c/naegling.c Normal file
View file

@ -0,0 +1,44 @@
/**
*
* naegling.c
*
* Naegling: a compiling Beowulf reimplementation.
*
* The memory management subsystem.
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include "memory.h"
#include "version.h"
__attribute__((__cdecl__))
extern int lisp_entry();
void showbits( unsigned int x )
{
int i=0;
for (i = (sizeof(int) * 8) - 1; i >= 0; i--)
{
putchar(x & (1u << i) ? '1' : '0');
}
printf("\n");
}
int main(int argc, char **argv) {
printf( "Naegling, a compiler for Beowulf: version %s\n", VERSION);
int val = lisp_entry();
printf("%d\n", val);
return 0;
}
return 0;
}

View file

@ -1,14 +1,14 @@
/**
* version.h
*
* Grendel: a compiling Beowulf reimplementation.
* Naegling: a compiling Beowulf reimplementation.
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __grendel_version_h
#define __grendel_version_h
#ifndef __naegling_version_h
#define __naegling_version_h
#define VERSIOM "Aelfhere"

View file

@ -2,7 +2,7 @@
;;
;; memory.scm
;;
;; Grendel: a compiling Beowulf reimplementation.
;; Naegling: a compiling Beowulf reimplementation.
;;
;; The memory management subsystem.
;;