Coder Social home page Coder Social logo

nimedlib's Introduction

nimedlib

A Nim wrapper for the Edlib library.

Synopsis

Edlib is an awesome library for doing non-affine-gap alignments. The venerable lh3 calls it very fast. I'm sure there is some smoothing to be done to make this more ergonimic (sic).

Install

This will be pushed to nimble once I've bombproofed it a bit.

git clone <this dir>
cd nimedlib
nimble install

Usage

import nimedlib

proc main() =
    var
        str1: cstring = "The dog bit the wall"
        str2: cstring = "The cat bit the wall"

    var result = edlibAlign(str1, cint(str1.len), str2, cint(str2.len),
            edlibDefaultAlignConfig())
    # May need to call edlibFreeAlignResult()
    echo result

when isMainModule:
    main()

Run with

nim cpp -r align_test.nim

Notes to future self

This was built with nimterop. It was very slick once I realized i needed to compile the nim programs that use the library with cpp. I initially started with a versino using nimgen, which can be found in the inital commit, and works if you run with cpp. 10/10, nim binding to C is a pleasure.

nimedlib's People

Contributors

sstadick avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nimedlib's Issues

Suggestions for nimterop

Great work getting this to work with nimterop. Some suggestions:-

  • Instead of using nimteropBuildDir(), would be better to have a path relative to your project using currentSourcePath.parentDir().
  • Remove cDisableCaching() so that users of your lib don't have to regenerate it every time they compile their project. It only makes sense during dev. of the lib.
  • You don't need either cAddStdDir("cpp") or cAddSearchDir(baseDir).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.