December 17, 2014
On Wednesday, 17 December 2014 at 19:48:00 UTC, Walter Bright wrote:
> Yeah, you just need to write another parser for the binary format, rather than reuse a canned D parser. :-)

A binary format for IR should just be mmap'ed and work without any parsing.
December 17, 2014
On Wed, 17 Dec 2014 11:47:24 -0800
Walter Bright via Digitalmars-d <digitalmars-d@puremagic.com> wrote:

> >> Storing it as body IR accomplishes nothing practical over storing it as source file, i.e. .di files.
> > except that there's no need to parse source code over and over again, which is good for other tools (like completion suggesting, intelligent code browsing and so on).
> >
> 
> Yeah, you just need to write another parser for the binary format, rather than reuse a canned D parser. :-)

yes. but with good design the mmaped binary file can be used as data structure. and we can avoid lookaheads that current textual parser do, as we already got AST built for us. just drop the idea that binary file must be small (in a sense of "squeezing bytes by clever integer encoding" and such) and portable, and think about "how can we use this mmaped?" with very good design we can also generate readers and writers almost automatically from AST definitions.


December 17, 2014
On 12/17/2014 11:50 AM, "Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang@gmail.com>" wrote:
> On Wednesday, 17 December 2014 at 19:48:00 UTC, Walter Bright wrote:
>> Yeah, you just need to write another parser for the binary format, rather than
>> reuse a canned D parser. :-)
>
> A binary format for IR should just be mmap'ed and work without any parsing.

I know how to do binary formats - the Digital Mars C++ compiler does precompiled headers using memory mapped files.

It isn't worth it.
December 17, 2014
On 12/17/2014 12:03 PM, ketmar via Digitalmars-d wrote:
> yes. but with good design the mmaped binary file can be used as data
> structure. and we can avoid lookaheads that current textual parser do,
> as we already got AST built for us. just drop the idea that binary file
> must be small (in a sense of "squeezing bytes by clever integer
> encoding" and such) and portable, and think about "how can we use this
> mmaped?" with very good design we can also generate readers and writers
> almost automatically from AST definitions.

As I replied to Ola, I've been there and done that. I know the ground. It isn't worth it.

December 17, 2014
On Wednesday, 17 December 2014 at 20:48:39 UTC, Walter Bright wrote:
> I know how to do binary formats - the Digital Mars C++ compiler does precompiled headers using memory mapped files.
>
> It isn't worth it.

Maybe not for headerfiles, but if you have an indexed database representing a compiled framework (partial evaluation/incomplete type support in templates) it should pay off if you preload the pages you need to access. If you run low on memory it also means you don't have to save pages to disk, the OS can just evict them.
December 17, 2014
On Wednesday, 17 December 2014 at 17:09:34 UTC, Andrei
Alexandrescu wrote:
> On 12/4/14 6:39 PM, deadalnix wrote:
>> On Thursday, 4 December 2014 at 13:48:04 UTC, Russel Winder via
>> Digitalmars-d wrote:
>>> It's an argument for Java over Python specifically but a bit more
>>> general in reality. This stood out for me:
>>>
>>> !…other languages like D and Go are too new to bet my work on."
>>>
>>> http://www.teamten.com/lawrence/writings/java-for-everything.html
>>
>> Also relevant:
>> http://wiki.jetbrains.net/intellij/Developing_and_running_a_Java_EE_Hello_World_application
>
> Very interesting. Even after all IDE details are factored out, the code is quite convoluted. No wonder Ruby on Rails and friends are so attractive by comparison. -- Andrei

Hah.  I tried RoR once.  I couldn't get the environment set up
and running and eventually just gave up.
December 18, 2014
On 12/17/2014 1:29 PM, "Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang@gmail.com>" wrote:
> On Wednesday, 17 December 2014 at 20:48:39 UTC, Walter Bright wrote:
>> I know how to do binary formats - the Digital Mars C++ compiler does
>> precompiled headers using memory mapped files.
>>
>> It isn't worth it.
>
> Maybe not for headerfiles, but if you have an indexed database representing a
> compiled framework (partial evaluation/incomplete type support in templates) it
> should pay off if you preload the pages you need to access. If you run low on
> memory it also means you don't have to save pages to disk, the OS can just evict
> them.

You're welcome to try it. I've spent a great deal of time on it, and it doesn't pay off.
December 18, 2014
On Thursday, 18 December 2014 at 00:27:49 UTC, Walter Bright wrote:
> You're welcome to try it. I've spent a great deal of time on it, and it doesn't pay off.

Regular HD I/O is quite slow, but with fast SSD on PCIe and a good database-like index locked to memory…
December 18, 2014
On Wednesday, 17 December 2014 at 22:24:09 UTC, Sean Kelly wrote:
> Hah.  I tried RoR once.  I couldn't get the environment set up
> and running and eventually just gave up.

Getting RoR set up and working for me + 4 people in a Windows environment was absolute hell. I'd never want to go through that again.
December 18, 2014
On Thu, Dec 18, 2014 at 12:37:43AM +0000, via Digitalmars-d wrote:
> On Thursday, 18 December 2014 at 00:27:49 UTC, Walter Bright wrote:
> >You're welcome to try it. I've spent a great deal of time on it, and it doesn't pay off.
> 
> Regular HD I/O is quite slow, but with fast SSD on PCIe and a good database-like index locked to memory…

That's hardly a solution that will work for the general D user, many of whom may not have this specific setup.


T

-- 
"I speak better English than this villain Bush" -- Mohammed Saeed al-Sahaf, Iraqi Minister of Information