Skip to content

Conversation

@ForNeVeR
Copy link
Member

Basic integer math support along with useful infrastructural changes.

@ForNeVeR ForNeVeR self-assigned this Dec 30, 2015
@ForNeVeR ForNeVeR force-pushed the feature/simple-instructions branch from 1edbce9 to 4f5ceb5 Compare January 4, 2016 16:58
@ForNeVeR ForNeVeR force-pushed the feature/simple-instructions branch from 4f5ceb5 to b898044 Compare March 7, 2016 14:38
@ForNeVeR
Copy link
Member Author

ForNeVeR commented Mar 7, 2016

I can say that this PR is pretty much done. Mr. @rexim, last time we discussed it you were willing to review a bit of Naggum code. Wanna give this PR a try?

@ForNeVeR ForNeVeR assigned rexim and unassigned ForNeVeR Mar 7, 2016
@ForNeVeR ForNeVeR changed the title [WIP] Math instruction support Math instruction support Mar 7, 2016
@ForNeVeR ForNeVeR changed the title Math instruction support Integer arithmetic Mar 9, 2016
@rexim
Copy link
Member

rexim commented Mar 17, 2016

@ForNeVeR, Do I understand correctly that you've added support to invoke primitive .NET arithmetical instructions from naggum and the next step is gonna be to define more high-level functions like +, -, /, *, etc?

@ForNeVeR
Copy link
Member Author

Well, that's a bit complicated. Look, Naggum.Assembler is a core for a low-level language. First thing you do when creating a low-level language is defining a mapping to the target machine language from your low-level language constructs. Hereby I define such mapping to primitive arithmetic instructions of our chosen target machine - CLI.

This is somewhat orthogonal to calling "functions" such as +. I don't think that Naggum.Assembler will include such functions at all. All that it will do is to assemble our low-level core language to actual .NET binaries. I still don't know whether it will expand macros (or we'll create another layer for them) and how it will interact with our current high-level Naggum.Compiler language.

And, yeah, regarding your question. That + function may conceptually be defined as a macro (expanding to the low-level instruction set I've created with this PR) or a real function (not expanded, but compiled to that low-level instruction set). Either way, + function is totally impossible without that arithmetic instructions, but currently I am not able to tell you how or when we'll have an ability to implement such functions in Naggum.

Honestly say, I even have no definition of function currently.

But you'll be able to define a method named, say, Add, and write it in terms of these new instructions, and even maybe call it using our (call ...) syntax.

@rexim
Copy link
Member

rexim commented Mar 17, 2016

@ForNeVeR that means I understood everything correctly from your change. I approve the PR.

@rexim rexim assigned ForNeVeR and unassigned rexim Mar 17, 2016
@ForNeVeR
Copy link
Member Author

Thanks for the review.

ForNeVeR added a commit that referenced this pull request Mar 17, 2016
@ForNeVeR ForNeVeR merged commit a4ef60b into develop Mar 17, 2016
@ForNeVeR ForNeVeR deleted the feature/simple-instructions branch March 17, 2016 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants