Marcus Holland-Moritz <mhx-p...@gmx.net> wrote: > One of my modules embeds the ucpp preprocessor, which has a > function init_tables(). The same function exists in parrot.
> One of my modules embeds the ucpp preprocessor, which has a > function init_tables(). The same function exists in parrot.
Renamed.
Another item for the embedding/extending todo list: namespace hygiene.
Some thought perhaps needs to go into creating a family of prefixes, and documenting their roles.
Mitchell (nipped by mark_hash last week)
$ nm ./blib/lib/libparrot.a |egrep ' [TDRC] |\.o:'|grep -v Parrot_ exceptions.o: 00000920 T do_exception 00000034 T do_panic 0000086c T handle_exception 00000000 T internal_exception 00000498 T new_c_exception_handler 0000089c T new_internal_exception 00000448 T pop_exception 00000220 T push_exception 000004d4 T push_new_c_exception_handler 00000974 T real_exception 0000064c T rethrow_c_exception 000005d8 T rethrow_exception 000004fc T throw_exception global_setup.o: 00000018 C class_count_mutex 00000004 C class_table_size 00000000 R data_types 00000004 C enum_class_max 00000000 T init_world 00000004 C interpreter_array 00000018 C interpreter_array_mutex 00000004 C n_interpreters 00000004 C run_native interpreter.o: 00002c4c T disable_event_checking 00000330 T do_prederef 0000256c T dynop_register 00002c70 T enable_event_checking 00002c94 T enter_nci_method 00000898 T exec_init_prederef 00000910 T init_jit 000021f0 T interpinfo 00000388 C interpre 00001ae4 T make_interpreter 000009bc T prepare_for_run 00001008 T runops 00000c64 T runops_int 000024cc T sysinfo_i 00002514 T sysinfo_s register.o: 000000cc T mark_pmc_register_stack 0000007c T mark_register_stack 00000194 T mark_string_register_stack 00000000 T setup_register_stacks memory.o: 000000dc T mem_setup_allocator 00000000 T mem_sys_allocate 00000040 T mem_sys_allocate_zeroed 000000c4 T mem_sys_free 00000080 T mem_sys_realloc objects.o: packfile.o: 00002d28 T PackFile_ConstTable_clear 00002dac T PackFile_ConstTable_unpack 00002f58 T PackFile_Constant_destroy 00002f30 T PackFile_Constant_new 00002f70 T PackFile_Constant_pack_size 000030a0 T PackFile_Constant_unpack 00003584 T PackFile_Constant_unpack_key 000033c8 T PackFile_Constant_unpack_pmc 000025c4 T PackFile_FixupTable_clear 00002a2c T PackFile_FixupTable_new_entry 0000127c T PackFile_Segment_destroy 00001514 T PackFile_Segment_dump 00001f44 T PackFile_Segment_new 000011fc T PackFile_Segment_new_seg 0000136c T PackFile_Segment_pack 000012c8 T PackFile_Segment_packed_size 0000144c T PackFile_Segment_unpack 000009c4 T PackFile_add_segment 00000000 T PackFile_destroy 00002ca4 T PackFile_find_fixup_entry 00000a20 T PackFile_find_segment 0000394c T PackFile_fixup_subs 00000d40 T PackFile_funcs_register 00000964 T PackFile_map_segments 00000bfc T PackFile_new 00000ac8 T PackFile_remove_segment_by_name 000006a8 T PackFile_unpack 00000f50 T default_dump_header 00000004 C exec_const_table 000003f4 T mark_const_subs stacks.o: 000006bc T get_entry_type 0000003c T mark_stack 00000018 T new_stack 0000062c T pop_dest 0000028c T rotate_entries 00000144 T stack_destroy 000001c8 T stack_entry 0000014c T stack_height 00000654 T stack_peek 00000540 T stack_pop 000004a0 T stack_push 00000000 T stack_system_init stack_common.o: 00000000 T cst_new_stack 00000088 T stack_copy 00000288 T stack_prepare_pop 00000130 T stack_prepare_push 000000cc T stack_unmake_COW string.o: 00000444 T const_string 000016bc T hash_string_equal 0000028c T string_append 00001918 T string_bitwise_and 00001ae8 T string_bitwise_or 00001d94 T string_bitwise_xor 00002040 T string_bool 000013cc T string_chopn 0000145c T string_compare 00000c7c T string_compute_strlen 00000cc8 T string_concat 00000a68 T string_copy 00002520 T string_cstring_free 000026d4 T string_downcase 000026f4 T string_downcase_inplace 0000179c T string_equal 000003ec T string_from_cstring 0000246c T string_from_int 00002498 T string_from_num 000005a0 T string_grow 00000610 T string_index 0000024c T string_init 00002658 T string_iterator_init 000005ec T string_length 00000480 T string_make 00000cb4 T string_max_bytes 000020ec T string_nprintf 000009b0 T string_ord 00002538 T string_pin 00000e6c T string_repeat 000010e8 T string_replace 000001f4 T string_set 000008dc T string_str_index 00000f2c T string_substr 00002710 T string_titlecase 00002730 T string_titlecase_inplace 000024c8 T string_to_cstring 000021ac T string_to_int 000021dc T string_to_num 00000a88 T string_transcode 000025b0 T string_unpin 00002698 T string_upcase 000026b8 T string_upcase_inplace sub.o: 00000024 T cow_copy_context 00000ea0 T lexicals_mark 00000168 T mark_context 0000071c T new_closure 00000790 T new_continuation 000007f8 T new_coroutine 000007c4 T new_ret_continuation 000008d4 T new_ret_continuation_pmc 000006a0 T new_sub 00000144 T restore_context 00000000 T save_context 00000ee0 T scratchpad_delete 00000d78 T scratchpad_get 00000968 T scratchpad_get_current 00000e00 T scratchpad_get_index 00000aa0 T scratchpad_new 00000c20 T scratchpad_store 00000cc0 T scratchpad_store_index 000004f0 T swap_context encoding.o: 00000070 T encoding_destroy 00000134 T encoding_find_encoding 00000000 T encoding_init 0000011c T encoding_lookup_index chartype.o: 000000ec T chartype_destroy 00000710 T chartype_find_chartype 00000824 T chartype_get_digit_map1 000008bc T chartype_get_digit_mapn 0000009c T chartype_init 000007f0 T chartype_is_digit_map1 00000864 T chartype_is_digit_mapn 000006f8 T chartype_lookup_index 00000740 T chartype_lookup_transcoder 00000914 T chartype_transcode_nop 00000010 D default_digit_map runops_cores.o: 00000044 T runops_cgoto_core 00000000 T runops_fast_core 000001e8 T runops_profile_core 00000068 T runops_slow_core trace.o: 000001d0 T trace_key_dump 000009d8 T trace_op 00000434 T trace_op_dump 00000000 T trace_pmc_dump pmc.o: 00000004 C PMCNULL 000003b0 T constant_pmc_new 00000440 T constant_pmc_new_init 00000374 T constant_pmc_new_noinit 00001280 T dod_register_pmc 000013cc T dod_unregister_pmc 00000018 C init_null_mutex 00000874 T mmd_fallback_add_pmc 00000b2c T mmd_fallback_band_pmc 00000b88 T mmd_fallback_bor_pmc 00000c40 T mmd_fallback_bsl_pmc 00000ca0 T mmd_fallback_bsr_pmc 00000be4 T mmd_fallback_bxor_pmc 00000a54 T mmd_fallback_cmod_pmc 00000d00 T mmd_fallback_concat_pmc 000009dc T mmd_fallback_divide_pmc 00000d7c T mmd_fallback_land_pmc 00000dd4 T mmd_fallback_lor_pmc 00000e2c T mmd_fallback_lxor_pmc 00000ac0 T mmd_fallback_mod_pmc 00000964 T mmd_fallback_multiply_pmc 00001024 T mmd_fallback_numcmp_pmc 00000f54 T mmd_fallback_numeq_pmc 00000ed8 T mmd_fallback_repeat_pmc 000010ac T mmd_fallback_strcmp_pmc 00000fc4 T mmd_fallback_streq_pmc 00001170 T mmd_fallback_stringand_pmc 00001100 T mmd_fallback_stringor_pmc 000011e0 T mmd_fallback_stringxor_pmc 000008ec T mmd_fallback_subtract_pmc 00000000 T pmc_init_null 00000070 T pmc_new 00000400 T pmc_new_init 0000022c T pmc_new_noinit 00000494 T pmc_register 000005fc T pmc_type 00000674 T register_fallback_methods pmc_freeze.o: key.o: 00000540 T key_append 00000258 T key_integer 00000580 T key_mark 00000000 T key_new 000000e8 T key_new_cstring 00000024 T key_new_integer 00000060 T key_new_number 00000118 T key_new_pmc 000000ac T key_new_string 00000530 T key_next 0000032c T key_number 000004cc T key_pmc 00000154 T key_set_integer 000001b0 T key_set_number 0000021c T key_set_pmc 00000180 T key_set_register 000001f0 T key_set_string 000003e8 T key_string 00000248 T key_type hash.o: 00000000 R NULLBucketIndex 00000004 R NULLHashIndex 0000033c T dump_hash 000010bc T hash_clone 00000f4c T hash_delete 00000e08 T hash_exists 00000dcc T hash_get 00000d5c T hash_get_bucket 00000c60 T hash_get_idx 00000e38 T hash_put 00000c28 T hash_size 00000638 T hash_visit 000004c0 T mark_hash 00000b40 T new_cstring_hash 00000b14 T new_hash 00000b68 T new_hash_x core_pmcs.o: platform.o: 000002cc T get_sys_timer_ms 0000032c T new_sys_timer_ms 000001fc T start_sys_timer_ms 000002b4 T stop_sys_timer_ms jit.o: 00001bc8 T build_asm 00000005 D floatval_map 00000000 D intval_map jit_cpu.o: 00029d00 T jit_op_count 00000060 D op_jit jit_debug.o: jit_debug_xcoff.o: rx.o: 00000000 R RX_MARK 0000000c D RX_NEWLINES 00000004 D RX_NUMCHARS 00000008 D RX_SPACECHARS 00000000 D RX_WORDCHARS 000002dc T bitmap_add 000003e4 T bitmap_destroy 000000ec T bitmap_make 0000020c T bitmap_make_cstr 00000360 T bitmap_match 000000a8 T rx_is_newline 00000044 T rx_is_number_character 00000064 T rx_is_whitespace_character 00000000 T rx_is_word_character rxstacks.o: 0000003c T intstack_depth 000001ac T intstack_free 00000000 T intstack_new 00000118 T intstack_pop 00000080 T intstack_push intlist.o: 0000006c T intlist_assign 0000001c T intlist_clone 00000198 T intlist_dump 00000154 T intlist_get 00000058 T intlist_length 00000000 T intlist_mark 0000003c T intlist_new 000000cc T intlist_pop 00000090 T intlist_push 00000110 T intlist_shift 000000ac T intlist_unshift list.o: 00000ae4 T ld 000020dc T list_assign 00001580 T list_clone 00001c5c T list_delete 00002170 T list_get 00001a54 T list_insert 00001974 T list_length 000017c4 T list_mark 0000120c T list_new 000012bc T list_new_init 00001f1c T list_pop 00001e80 T list_push 00001988 T list_set_length 00001ff0 T list_shift 000021d0 T list_splice 00001eb4 T list_unshift 0000189c T list_visit embed.o: warnings.o: 000000dc T print_pbc_location 00000148 T print_pbc_location_stdio packout.o: 0000017c T PackFile_ConstTable_pack 00000120 T PackFile_ConstTable_pack_size 0000029c T PackFile_Constant_pack 0000004c T PackFile_pack 00000000 T PackFile_pack_size byteorder.o: 00000190 T fetch_buf_be_12 00000268 T fetch_buf_be_16 00000084 T fetch_buf_be_4 000000dc T fetch_buf_be_8 00000174 T fetch_buf_le_12 0000024c T fetch_buf_le_16 000000c0 T fetch_buf_le_4 00000158 T fetch_buf_le_8 0000000c T fetch_iv_be 00000000 T fetch_iv_le 00000040 T fetch_op_be 00000078 T fetch_op_le debug.o: 00003068 T PDB_add_label 00002094 T PDB_break 00001cc0 T PDB_check_condition 000038dc T PDB_compile 00000cb4 T PDB_cond 00001854 T PDB_continue
...
> > One of my modules embeds the ucpp preprocessor, which has a > > function init_tables(). The same function exists in parrot.
> Renamed.
> Another item for the embedding/extending todo list: namespace hygiene.
> Some thought perhaps needs to go into creating a family of prefixes, > and documenting their roles.
> Mitchell > (nipped by mark_hash last week)
I agree that this is rather important.
I think all parrot externally visible macros, types and all functions should be prefixed Parrot_ as a start.
Are patches welcome that change this? Changing one at a time is not going to be really helpful. All it does is make following CVS changes a bit painful.
Arthur Bergman <s...@nanisky.com> wrote: > I think all parrot externally visible macros, types and all functions > should be prefixed Parrot_ as a start. > Are patches welcome that change this?
Sure. But we should allow some already used prefixes too, beside Parrot_. We have: - Parrot_ API - PDB_ Parrot Debugger - PF_ PackFile - PackFile_ PackFile - PIO_ Parrot IO
> ... Changing one at a time is not > going to be really helpful. All it does is make following CVS changes a > bit painful.
Arthur Bergman <s...@nanisky.com> wrote: > PDB is too generic ParrotDB_ >> - PF_ PackFile > ParrotPF , PF alone is already a taken prefix for Packet Filter if I > don't recall wrong, not to mention the ancient define of PF_ >> - PackFile_ PackFile > PackFile_ is too generic IMO too, and why PF and PackFile?
The PF_ functions are low-level. I'd started to separate packfile.c and during that used the PF_ prefix. Anyway "ParrotPF_" is good for both.
>> - PIO_ Parrot IO
> ParrotIO_
Ok. Thanks.
> Cheers > Arthur
May be its best if someone who has commit privs just changes the globals and puts it in - its of not much help to send around huge patches.
Of course, "ParrotDB" sounds like "Parrot database"....
> May be its best if someone who has commit privs just changes the > globals > and puts it in - its of not much help to send around huge patches.
We should be able to get the linker to only expose our external entry points from libparrot. That way, we don't have to worry about the naming of API which isn't supposed to be called from outside. (If it works, it's simpler and safer than relying on a prefix.)
> Of course, "ParrotDB" sounds like "Parrot database"....
>> May be its best if someone who has commit privs just changes the >> globals >> and puts it in - its of not much help to send around huge patches.
> We should be able to get the linker to only expose our external entry > points from libparrot. That way, we don't have to worry about the > naming of API which isn't supposed to be called from outside. (If it > works, it's simpler and safer than relying on a prefix.)
> JEff
And how would this be done across platforms, if this works I am happy with it, but I don't know how.
> We should be able to get the linker to only expose our external entry > points from libparrot. That way, we don't have to worry about the > naming of API which isn't supposed to be called from outside. (If it > works, it's simpler and safer than relying on a prefix.) > > JEff
And how would this be done across platforms, if this works I am happy with it, but I don't know how.
Arthur
We could always use a source preprocessor to add a uN1qUePr1VaTe_ prefix to a list of unprefixed global symbols... ;)
Mitchell (not entirely in jest -- robust prefixing so clutters code:)
On Mar 15, 2004, at 9:22 AM, Arthur Bergman wrote:
> On 15 Mar 2004, at 17:20, Jeff Clites wrote:
>> We should be able to get the linker to only expose our external entry >> points from libparrot. That way, we don't have to worry about the >> naming of API which isn't supposed to be called from outside. (If it >> works, it's simpler and safer than relying on a prefix.)
> And how would this be done across platforms, if this works I am happy > with it, but I don't know how.
On Mac OS X and Linux at least, as I understand it this can be done with either 'ld' or 'strip'. (The 'ld' argument for this on Mac OS X is -exported_symbols_list, and on Linux it's --retain-symbols-file, each taking the name of a file containing the list of symbols to retain.) I'd imagine that other Unices have similar linker options, and I'd think that Windows would have an equivalent also.
I haven't actually tried this, but the tools seem to be there.
> > One of my modules embeds the ucpp preprocessor, which has a > > function init_tables(). The same function exists in parrot.
> Renamed.
>Another item for the embedding/extending todo list: namespace hygiene.
Ultimately the linker needs to expose only those symbols which we want exposed, and those symbols need a unique prefix. Yeah, it'll be a cross-platform pain, but it needs doing, and it is doable. -- Dan
--------------------------------------"it's like this"------------------- Dan Sugalski even samurai d...@sidhe.org have teddy bears and even teddy bears get drunk
One could also take a look at tools/dev/nm.pl, something I submitted to Leo a few days back. Basically, it tries to be a portable nm frontend. nm.pl -g -o libparrot.a does more or less the same what you did.