9front - general discussion about 9front
 help / color / mirror / Atom feed
* Bounty: OCaml 4.11.1
@ 2020-11-21  5:37 McKay Marston
  2020-11-21  5:46 ` [9front] " ori
  0 siblings, 1 reply; 5+ messages in thread
From: McKay Marston @ 2020-11-21  5:37 UTC (permalink / raw)
  To: 9front

Hello,

OCaml 4.07 is in ports (great work, btw), but it’s getting stale. I’d like to try my hand at porting other tools (like dune and opam), but they won’t work with something so old. Also, newer versions support more architectures (arm, specifically).

I tried porting it myself, but it relies heavily on aligned memory blocks that are generated in preprocessor macros, and I gave up trying to figure out how that could be done in plan9.

I’ll pay $100 for a working port of OCaml 4.11.1

Must have:
 * a working build system for OCaml
 * working ‘ocaml’ REPL / interpreter capable of running .ml files
 * working ‘ocamlc’
 * working ‘ocamlopt’

I think the binaries will probably all just fall out of a working build environment.

Thanks!

—
zgasma




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9front] Bounty: OCaml 4.11.1
  2020-11-21  5:37 Bounty: OCaml 4.11.1 McKay Marston
@ 2020-11-21  5:46 ` ori
  2020-11-21  6:24   ` McKay Marston
  0 siblings, 1 reply; 5+ messages in thread
From: ori @ 2020-11-21  5:46 UTC (permalink / raw)
  To: mckay.marston, 9front

Quoth McKay Marston <mckay.marston@greymanlabs.com>:
> I tried porting it myself, but it relies heavily
> on aligned memory blocks that are generated in
> preprocessor macros, and I gave up trying to
> figure out how that could be done in plan9.

I don't have the time to do the full port myself,
but do you have any specific examples of
the kind of thing that's giving trouble?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9front] Bounty: OCaml 4.11.1
  2020-11-21  5:46 ` [9front] " ori
@ 2020-11-21  6:24   ` McKay Marston
  2020-11-21 19:56     ` Nick Owens
  0 siblings, 1 reply; 5+ messages in thread
From: McKay Marston @ 2020-11-21  6:24 UTC (permalink / raw)
  To: 9front



> On Nov 20, 2020, at 10:46 PM, ori@eigenstate.org wrote:
> 
> Quoth McKay Marston <mckay.marston@greymanlabs.com>:
>> I tried porting it myself, but it relies heavily
>> on aligned memory blocks that are generated in
>> preprocessor macros, and I gave up trying to
>> figure out how that could be done in plan9.
> 
> I don't have the time to do the full port myself,
> but do you have any specific examples of
> the kind of thing that's giving trouble?

Well, specifically this:

runtime/caml/misc.h:
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#define CAMLalign(n) _Alignas(n)
#elif defined(SUPPORTS_ALIGNED_ATTRIBUTE)
#define CAMLalign(n) __attribute__((aligned(n)))
#elif _MSC_VER >= 1500
#define CAMLalign(n) __declspec(align(n))
#else
#error "How do I align values on this platform?”   <- this is where it bails on plan9
#endif

which is used by:

runtime/caml/domain_state.h
#define DOMAIN_STATE(type, name) CAMLalign(8) type name;
#define DOMAIN_STATE(type, name) CAMLalign(8) type _##name;

which is used by a bunch of stuff like this:

DOMAIN_STATE(intnat, stat_compactions)
DOMAIN_STATE(intnat, stat_heap_chunks)

And my issue is that the only way that I can see to align memory in plan9 is with mallocalign, which isn’t easily translated (by me, at least) into something that works with the “set an aligned attribute at declaration" method used here.

If I’m missing something, though, I’d appreciate any guidance.

—
zgasma
Mckay Marston



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9front] Bounty: OCaml 4.11.1
  2020-11-21  6:24   ` McKay Marston
@ 2020-11-21 19:56     ` Nick Owens
  2020-11-21 22:15       ` McKay Marston
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Owens @ 2020-11-21 19:56 UTC (permalink / raw)
  To: 9front

On Fri, Nov 20, 2020 at 11:24:01PM -0700, McKay Marston wrote:
> 
> 
> > On Nov 20, 2020, at 10:46 PM, ori@eigenstate.org wrote:
> > 
> > Quoth McKay Marston <mckay.marston@greymanlabs.com>:
> >> I tried porting it myself, but it relies heavily
> >> on aligned memory blocks that are generated in
> >> preprocessor macros, and I gave up trying to
> >> figure out how that could be done in plan9.
> > 
> > I don't have the time to do the full port myself,
> > but do you have any specific examples of
> > the kind of thing that's giving trouble?
> 
> Well, specifically this:
> 
> runtime/caml/misc.h:
> #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
> #define CAMLalign(n) _Alignas(n)
> #elif defined(SUPPORTS_ALIGNED_ATTRIBUTE)
> #define CAMLalign(n) __attribute__((aligned(n)))
> #elif _MSC_VER >= 1500
> #define CAMLalign(n) __declspec(align(n))
> #else
> #error "How do I align values on this platform?”   <- this is where it bails on plan9
> #endif
> 
> which is used by:
> 
> runtime/caml/domain_state.h
> #define DOMAIN_STATE(type, name) CAMLalign(8) type name;
> #define DOMAIN_STATE(type, name) CAMLalign(8) type _##name;
> 
> which is used by a bunch of stuff like this:
> 
> DOMAIN_STATE(intnat, stat_compactions)
> DOMAIN_STATE(intnat, stat_heap_chunks)
> 
> And my issue is that the only way that I can see to align memory in plan9 is with mallocalign, which isn’t easily translated (by me, at least) into something that works with the “set an aligned attribute at declaration" method used here.
> 
> If I’m missing something, though, I’d appreciate any guidance.

what happens if you cheat and define it as nothing?

> 
> —
> zgasma
> Mckay Marston
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9front] Bounty: OCaml 4.11.1
  2020-11-21 19:56     ` Nick Owens
@ 2020-11-21 22:15       ` McKay Marston
  0 siblings, 0 replies; 5+ messages in thread
From: McKay Marston @ 2020-11-21 22:15 UTC (permalink / raw)
  To: 9front


> On Nov 21, 2020, at 12:59, Nick Owens <mischief@offblast.org> wrote:
> 
> On Fri, Nov 20, 2020 at 11:24:01PM -0700, McKay Marston wrote:
>> 
>> 
>>>> On Nov 20, 2020, at 10:46 PM, ori@eigenstate.org wrote:
>>> 
>>> Quoth McKay Marston <mckay.marston@greymanlabs.com>:
>>>> I tried porting it myself, but it relies heavily
>>>> on aligned memory blocks that are generated in
>>>> preprocessor macros, and I gave up trying to
>>>> figure out how that could be done in plan9.
>>> 
>>> I don't have the time to do the full port myself,
>>> but do you have any specific examples of
>>> the kind of thing that's giving trouble?
>> 
>> Well, specifically this:
>> 
>> runtime/caml/misc.h:
>> #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
>> #define CAMLalign(n) _Alignas(n)
>> #elif defined(SUPPORTS_ALIGNED_ATTRIBUTE)
>> #define CAMLalign(n) __attribute__((aligned(n)))
>> #elif _MSC_VER >= 1500
>> #define CAMLalign(n) __declspec(align(n))
>> #else
>> #error "How do I align values on this platform?”   <- this is where it bails on plan9
>> #endif
>> 
>> which is used by:
>> 
>> runtime/caml/domain_state.h
>> #define DOMAIN_STATE(type, name) CAMLalign(8) type name;
>> #define DOMAIN_STATE(type, name) CAMLalign(8) type _##name;
>> 
>> which is used by a bunch of stuff like this:
>> 
>> DOMAIN_STATE(intnat, stat_compactions)
>> DOMAIN_STATE(intnat, stat_heap_chunks)
>> 
>> And my issue is that the only way that I can see to align memory in plan9 is with mallocalign, which isn’t easily translated (by me, at least) into something that works with the “set an aligned attribute at declaration" method used here.
>> 
>> If I’m missing something, though, I’d appreciate any guidance.
> 
> what happens if you cheat and define it as nothing?
> 
>> 
>> —
>> zgasma
>> Mckay Marston
>> 

Interesting thought. It certainly got farther, so I’ll keep working at. Thanks for the suggestion!

The bounty still stands, though, unless I make a breakthrough.

—
zgasma
McKay Marston



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-21 22:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-21  5:37 Bounty: OCaml 4.11.1 McKay Marston
2020-11-21  5:46 ` [9front] " ori
2020-11-21  6:24   ` McKay Marston
2020-11-21 19:56     ` Nick Owens
2020-11-21 22:15       ` McKay Marston

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 NNTP newsgroup(s).