Code Monkey home page Code Monkey logo

construct's People

Contributors

thomas-de-bock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

construct's Issues

boost lib dependence

using boost 1.84 worked
-Iboost_1_84_0/

edit: boost is a library

file 'src/deconstruct.h'
#include<boost/algorithm/string/classification.hpp>
#include<boost/algorithm/string/split.hpp>
#include<boost/algorithm/string.hpp>

C++ standard

I would like to create some PR with improvements, however, I would like to use c++17 and c++20 features.

Have you decided in any maximum standard to support?
Or I can go wild with newer c++ versions?

Help Message

A help message should show when running Construct with no arguments, or if the -h or --help flag is set. The help message could provide details about version, and usage. Here is a help message example:

Construct (version 1.1.0)
An abstraction over x86 assembly providing useful shortcuts and syntax.

Usage:
-i Input file. Should have valid construct syntax, and optionally have the extension .con
-f Output format. Can be either elf64, elf32, elf16, or elf8
-o Output file. Specifies where to put the resulting assembly file.

2024 Code_Nybble
MIT LICENSE
https://github.com/Thomas-de-Bock/construct/

Graceful error handling

When running Construct with one of the examples (factorial.con), I get a malloc error. Construct should handle these gracefully and provide detailed error messages and fail gracefully.

blue@computer ~/D/c/examples [1]> construct -f elf64 -i factorial.con -o out.asm
construct(26020,0x1dd1d5ec0) malloc: *** error for object 0x600003bfc000: pointer being freed was not allocated
construct(26020,0x1dd1d5ec0) malloc: *** set a breakpoint in malloc_error_break to debug
fish: Job 1, 'construct -f elf64 -i factorial…' terminated by signal SIGABRT (Abort)

Nixpkgs package

Hello!

I love this compiler and find it super interesting :)

I've open a PR on NixOS/nixpkgs#289114 to get this utility available on nixpkgs.

This will allow other nixpkgs packages to depend on it to build their code, create my own flakes environment with this tool available and installing it easily with nix/ home-manager/ nix-env / nix-shell.

Better command formatting & argument

Construct's command line arguments are awkward and hard to understand. To fix this, Construct could follow the likes of nasm, which is invoked like

nasm -f elf64 -o cool.o cool.asm

The input file doesn't use a flag, instead it is an unnamed argument. Also, flag names could have alternative long names, like --format for the -f flag, and so on.

Support for `macho` assembly output

Adding support for outputting Mach-O assembly instead of Elf would be awesome (as of writing this, running on macOS produces errors when assembling & linking binaries produced by Construct)

Wasn't able to contribute.

FTS i was working on the project makefile and work dir and failed to contrib.
and i decided to give you the makefile anyway.

# Compiler and it's stuff
CXX     := g++
CFLAGS  := -Wall -Wextra -march=native -I ./
ifeq ($(DBG),1)
        CFLAGS  += -g   # debug flag: make DBG=1
endif

# Output and Srcs (for objects).
SRC     := inc
OUT     := ../out
SRCS    := $(wildcard $(SRC)/*.cpp)
OBJS    := $(patsubst $(SRC)/%.cpp, $(OUT)/%.o, $(SRCS))

# Dest Bin
ifndef ($(TARGET))
        BIN     := ../bin
        TARGET  := $(BIN)/construct     # out filename
endif

# ENTRY argument could be useful for test compilation.
ifndef ($(ENTRY))
        ENTRY   := construct.cpp
endif
# Exposed
.PHONY: init all clean

# Building Objs
$(OUT)/%.o: $(SRC)/%.cpp
        @echo "CXX $@ $<"
        @$(CXX) $(CFLAGS) -c $< -o $@

# Target build
$(TARGET): $(OBJS) $(ENTRY)
        @echo "CXX $@"
        @$(CXX) $(CFLAGS) -Wl,--build-id=uuid $^ -o $@

# Entry
all: $(TARGET)

# Init wd
init:
        @echo "* INIT"
        @mkdir -p $(BIN) $(OUT)

# Clean wd
clean:
        @echo "* CLEAN"
        @rm -rf $(BIN) $(OUT)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.