* terribly complex syntax objects in syntax parse
@ 2012-05-14 19:54 Stefan Israelsson Tampe
2012-05-14 22:04 ` Mark H Weaver
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Israelsson Tampe @ 2012-05-14 19:54 UTC (permalink / raw)
To: guile-devel
[-- Attachment #1: Type: text/plain, Size: 305 bytes --]
Hi,
syntax-parse is kind of heavy right now. The parser function produced are
huge and the main reason
is that the stored syntax objects are enormous. I know that Mark Weaver had
done something to make
these creatures less fatty. The question is if there is anything a guile
user can do?
Regards
Stefan
[-- Attachment #2: Type: text/html, Size: 334 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: terribly complex syntax objects in syntax parse
2012-05-14 19:54 terribly complex syntax objects in syntax parse Stefan Israelsson Tampe
@ 2012-05-14 22:04 ` Mark H Weaver
2012-05-15 15:10 ` Stefan Israelsson Tampe
0 siblings, 1 reply; 4+ messages in thread
From: Mark H Weaver @ 2012-05-14 22:04 UTC (permalink / raw)
To: Stefan Israelsson Tampe; +Cc: guile-devel
Hi Stefan,
Stefan Israelsson Tampe <stefan.itampe@gmail.com> writes:
> syntax-parse is kind of heavy right now. The parser function produced
> are huge and the main reason
> is that the stored syntax objects are enormous.
Yes, this is very unfortunate. These syntax-objects add a huge amount
of bloat to our entire system. The vast majority of each syntax-object
is used only if the syntax-object is passed as the first argument to
'datum->syntax'. Of course, most syntax-objects are never passed to
'datum->syntax', but unless the compiler can prove that this will never
happen, the bloat must be kept around.
> I know that Mark Weaver had done something to make these creatures
> less fatty.
I wrote a hack to minimize the size of syntax objects in psyntax-pp.scm.
However, the hack cannot safely be used in the general case. It is only
safe because I convinced myself and others that the syntax-objects
embedded within psyntax-pp.scm will never be passed to 'datum->syntax'.
> The question is if there is anything a guile user can do?
My hack cannot be used by users because it makes assumptions about the
internals of psyntax and of our compiler: assumptions that will
certainly to be violated in future versions of Guile.
I wish I had a better answer for you, but unfortunately these enormous
syntax-objects are a core part of the 'syntax-case' system. I see no
way to eliminate this bloat without moving to a different macro system.
Best,
Mark
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: terribly complex syntax objects in syntax parse
2012-05-14 22:04 ` Mark H Weaver
@ 2012-05-15 15:10 ` Stefan Israelsson Tampe
2012-05-15 18:41 ` Andy Wingo
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Israelsson Tampe @ 2012-05-15 15:10 UTC (permalink / raw)
To: Mark H Weaver; +Cc: guile-devel
[-- Attachment #1: Type: text/plain, Size: 2226 bytes --]
> I wish I had a better answer for you, but unfortunately these enormous
> syntax-objects are a core part of the 'syntax-case' system. I see no
> way to eliminate this bloat without moving to a different macro system.
Hey one can do what one can do. 1000rows of scheme results currently in
500kB go file mainly due to these syntax objects. On the other hand does
the compiler create object data intelligently making sure that eq? objects
is created only
once? hence a reuse of common subexpressions. That can compress the bloat
a bit I suspect!
/Stefan
Anyway I think you mentioned you wanted a refisgn of the syn
On Tue, May 15, 2012 at 12:04 AM, Mark H Weaver <mhw@netris.org> wrote:
> Hi Stefan,
>
> Stefan Israelsson Tampe <stefan.itampe@gmail.com> writes:
> > syntax-parse is kind of heavy right now. The parser function produced
> > are huge and the main reason
> > is that the stored syntax objects are enormous.
>
> Yes, this is very unfortunate. These syntax-objects add a huge amount
> of bloat to our entire system. The vast majority of each syntax-object
> is used only if the syntax-object is passed as the first argument to
> 'datum->syntax'. Of course, most syntax-objects are never passed to
> 'datum->syntax', but unless the compiler can prove that this will never
> happen, the bloat must be kept around.
>
> > I know that Mark Weaver had done something to make these creatures
> > less fatty.
>
> I wrote a hack to minimize the size of syntax objects in psyntax-pp.scm.
> However, the hack cannot safely be used in the general case. It is only
> safe because I convinced myself and others that the syntax-objects
> embedded within psyntax-pp.scm will never be passed to 'datum->syntax'.
>
> > The question is if there is anything a guile user can do?
>
> My hack cannot be used by users because it makes assumptions about the
> internals of psyntax and of our compiler: assumptions that will
> certainly to be violated in future versions of Guile.
>
> I wish I had a better answer for you, but unfortunately these enormous
> syntax-objects are a core part of the 'syntax-case' system. I see no
> way to eliminate this bloat without moving to a different macro system.
>
> Best,
> Mark
>
[-- Attachment #2: Type: text/html, Size: 2848 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: terribly complex syntax objects in syntax parse
2012-05-15 15:10 ` Stefan Israelsson Tampe
@ 2012-05-15 18:41 ` Andy Wingo
0 siblings, 0 replies; 4+ messages in thread
From: Andy Wingo @ 2012-05-15 18:41 UTC (permalink / raw)
To: Stefan Israelsson Tampe; +Cc: Mark H Weaver, guile-devel
On Tue 15 May 2012 17:10, Stefan Israelsson Tampe <stefan.itampe@gmail.com> writes:
> Hey one can do what one can do. 1000rows of scheme results currently in
> 500kB go file mainly due to these syntax objects.
That's terrible...
> On the other hand does the compiler create object data intelligently
> making sure that eq? objects is created only once? hence a reuse of
> common subexpressions. That can compress the bloat a bit I suspect!
It should do that, yes. If it doesn't, that's a bug!
Andy
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-05-15 18:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-14 19:54 terribly complex syntax objects in syntax parse Stefan Israelsson Tampe
2012-05-14 22:04 ` Mark H Weaver
2012-05-15 15:10 ` Stefan Israelsson Tampe
2012-05-15 18:41 ` Andy Wingo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).