C/AL Source Code

MTCMTC Member Posts: 159
Where is it stored, and how can I access it?

If it's not possible through the client, can I get at it via SQL if the DB is placed on SQL Server?

I suppose it's in some BLOB field?

I'm really not in the mood to start disassembling the client binary for several weeks.

Anybody know how to get access to it?

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    :shock:

    Have you even try to look for documentation??

    The manual is on the product CD.
  • MTCMTC Member Posts: 159
    I don't want to know how to access it for NAV programming purposes, I want to get at where it it actually stored.

    Example: I want to write a C/AL compiler (need to know where the source code is and where to stick the binary result). I don't actually, but do you now get the drift of the question?
  • MTCMTC Member Posts: 159
    Also, is NAV compiling the code to a machine native binary, or rather some object type file which it runs through some kind of virtual machine?
  • Alex_ChowAlex_Chow Member Posts: 5,063
    Not sure about the SQL version, but in standard database, it's all stored in the .FDB file.
  • TrippyZTrippyZ Member Posts: 87
    The code is stored in a blob field in the Object table.
    Professional Navision Developer
  • pdjpdj Member Posts: 643
    MTC wrote:
    I want to get at where it it actually stored.
    I guess you want to be able to do the same as the DevTool and import and export C/AL code. The DevTool uses an API which I guess anyone could use by a bit of reverse engineering. This could be used for multiple funny stuff, however making a new C/AL compiler doesn't make much sense imho :-)
    A new editor would however be highly appriciated, but many have tried and failed. Search the forum and learn by their experiences.
    However; Celenia Software have made a version control tool that might do some of the stuff you are looking for.
    Regards
    Peter
  • DakkonDakkon Member Posts: 192
    The code is stored in a byte compiled format inside the blob field. There is unfortunately no way to get at the raw C/AL code programmatically.
    I've been working on a navision object file parser in C# for a while so that I could export objects out into a text format and parse them into a seperate program, much like the developer toolkit. I do plan to post the project here on Mibuso when complete. I am publishing it under the Apache License. Incidentally once the parser is done I am planning to write an extensible IDE that will make use of this, but there have been so many IDE's at this point I don't expect anyone to wait in anticipation ;p
    Thad Ryker
    I traded my sanity for a railgun :mrgreen:
  • kinekine Member Posts: 12,562
    1) Yes, the code is stored in BLOB field in Object table
    2) The code is encrypted in some way in this BLOB
    3) There is opened port by the client over which you can communicate with the client and read the objects, but the protocol is unknown (NDT is using it, but because it is just over loopback, I was unable to catch the communication and look at it...)
    4) Fin.exe and finsql.exe are just C/AL interpreters. It means that the object definition is pre-compiled into some mid-code and interpreted when running.
    5) Because things are changing, it is wasted time to create some new IDEs and other things, because in couple of year you will find out that everything changed... (IDE, internal structure...) Look on the Dynamics roadmap and read all the things which are planned for year 2009+ (yes, there is still enough time, but have you enough time to waste it?)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • MTCMTC Member Posts: 159
    Mmmmm, this is unfortunate.

    Thanks for the responses though people.
  • DakkonDakkon Member Posts: 192
    I have to say I completely disagree about everything changing. Sure the client has changed over time (and not by much), but how much has the C/AL language syntax changed? The core of the language hasn't changed, and the editor has only received minor improvements (even in 5.1 it looks like developers are getting very little change to the editor). No syntax highlighting, no refactoring tools, no formatting rules as far as I've seen (some of you undoubtedly know more about 5.1 than myself). Also given MS's timeline history, I'm not holding my breath on any major improvements earlier than 4-5 years. If indeed we do end up waiting 4 years, then I think tools to bridge that time gap would be worth their time. Additionally you must consider all those developers who are stuck on older versions for many years to come. Those developers would still benefit from better editor. In the end, I can hardly call better tools a waste of time
    Thad Ryker
    I traded my sanity for a railgun :mrgreen:
  • TrippyZTrippyZ Member Posts: 87
    Dakkon, don't forget the biggest improvement in 5.0, tabbing in the source code! Yeehah.
    Professional Navision Developer
  • DakkonDakkon Member Posts: 192
    That makes the whole wait worth it ;)
    Speaking of though, does anyone know where to find a simple compiled list of editor feature improvements in 5.0 and the planned improvements for 5.1?
    I'd be curious to see a final list of details.
    Thad Ryker
    I traded my sanity for a railgun :mrgreen:
  • kinekine Member Posts: 12,562
    edited 2007-04-12
    :-) I am not speaking about v 5.0 or 5.1. There are no changes in the C/Side. But if you look at the latest roadmap, you will see that there is "Microsoft Dynamics Tools" and "Simple model-driven development & customization". Do you think that it will be possible with the old C/Side? And it is planned for "shipping in 2009". But who knows... ;-)

    Microsoft has enough power to do that... :mrgreen:

    Now, when the new Role Based Client is based on new technology, it will be not problem to change the background behind all that.

    Of course, you can try to decrypt the blob or protocol, but I have some experiences with that with poor effect. And I think that I was not alone... 8)

    (I didn't spend too much time with that)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • MTCMTC Member Posts: 159
    I've spent all day doing analysis on the data in these BLOBs, using a Hex editor and a file compare tool to try to understand what is what, changing something and comparing it to what was before. It's quite interesting, but I've worked quite a lot of things out already. The client seems to generate the source code on the fly, it isn't stored on its own, but rather intertwined with the pseudo binary. It's not as difficult as I first thought. Access to the specification for the FOB files would seriously help though in cutting the time down, but I suppose that is totally out of the question.

    Probably helps that I have coded machines in assembly language in the past.
Sign In or Register to comment.