<commit_before>! Copyright (C) 2009 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays combinators fry generalizations
io.encodings.ascii io.files io.files.temp io.launcher kernel
locals make sequences system vocabs.parser words ;
IN: alien.inline.compiler

SYMBOL: C
SYMBOL: C++

: library-suffix ( -- str )
    os {
        { [ dup macosx? ]  [ drop ".dylib" ] }
        { [ dup unix? ]    [ drop ".so" ] }
        { [ dup windows? ] [ drop ".dll" ] }
    } cond ;

: library-path ( str -- str' )
    '[
        "lib-" % current-vocab name>> %
        "-" % _ % library-suffix %
    ] "" make temp-file ;

: src-suffix ( lang -- str )
    {
        { C [ ".c" ] }
        { C++ [ ".cpp" ] }
    } case ;

: compiler ( lang -- str )
    {
        { C [ "gcc" ] }
        { C++ [ "g++" ] }<commit_msg>alien.inline.compile: compiler: use eg++ on openbsd<commit_after>! Copyright (C) 2009 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays combinators fry generalizations
io.encodings.ascii io.files io.files.temp io.launcher kernel
locals make sequences system vocabs.parser words ;
IN: alien.inline.compiler

SYMBOL: C
SYMBOL: C++

: library-suffix ( -- str )
    os {
        { [ dup macosx? ]  [ drop ".dylib" ] }
        { [ dup unix? ]    [ drop ".so" ] }
        { [ dup windows? ] [ drop ".dll" ] }
    } cond ;

: library-path ( str -- str' )
    '[
        "lib-" % current-vocab name>> %
        "-" % _ % library-suffix %
    ] "" make temp-file ;

: src-suffix ( lang -- str )
    {
        { C [ ".c" ] }
        { C++ [ ".cpp" ] }
    } case ;

HOOK: compiler os ( lang -- str )

M: word compiler ( lang -- str )
    {
        { C [ "gcc" ] }
        { C++ [ "g++" ] }
    } case ;

M: openbsd compiler ( lang -- str )
    {
        { C [ "gcc" ] }
        { C++ [ "eg++" ] }
{'fraction_non_alphanumeric': 0.17757510729613735, 'fraction_numerical': 0.004291845493562232, 'mean_word_length': 1.8825347758887172, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '241728', 'n_tokens_mistral': 684, 'n_tokens_neox': 656, 'n_words': 168}