Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005537OCamlOCaml backend (code generation)public2012-03-13 20:422012-12-13 17:09
Reportersweeks 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version 
Target Version4.01.0+devFixed in Version 
Summary0005537: reducing repeated indirections to access variables in nested modules
DescriptionOCaml's compilation strategy for variable references in nested modules leaves
around unnecessary field accesses, which are implicit, and not felt by the
programmer.

For example, if I write:

   open Core.Std
   let f () = Result.ok_unit

the reference to [Result.ok_unit] gets compiled to three field accesses, one for
each dot in [Core.Std.Result.ok_unit]. Furthermore, these accesses happen every
time [f] is called. I think it would typically be prefereable if [f] were
compiled as if it had been written as follows:

   let z = Result.ok_unit in
   let f = fun () -> z

I think it is surprising to a programmer for variable reference to be such a
non-constant-time operation.
TagsNo tags attached.
Attached Files

- Relationships
has duplicate 0005573acknowledged Access to values in nested modules 
related to 0005546resolvedfrisch moving a function into an internal module slows down its use 

-  Notes
(0008604)
frisch (developer)
2012-12-13 17:09

Probably solved by 0005546.

- Issue History
Date Modified Username Field Change
2012-03-13 20:42 sweeks New Issue
2012-03-20 10:44 gasche Relationship added related to 0005546
2012-03-26 14:41 lefessan Status new => acknowledged
2012-04-04 22:46 gasche Relationship added has duplicate 0005573
2012-07-10 11:28 doligez Target Version => 4.01.0+dev
2012-07-31 13:36 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-21 12:55 doligez Target Version 4.00.1+dev => 4.01.0+dev
2012-12-13 17:09 frisch Note Added: 0008604


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker