Why code with LDT?

Who am I?

Kévin KIN-FOO, working at Sierra Wireless.

Working on LDT since 2009.

The approach

  • IDE or Editor
  • LDT among IDEs
  • What does it offer

IDE or Editor

  • I am not entering this debate
  • If your read this, you are interested in IDE
  • We try to keep it light
  • We do not aim convert editor users

LDT among IDEs

  • I am not entering this either
  • This talk is not about comparison
  • It is about explaining how we do things

The real approach

  • IDE or Editor
  • LDT among IDEs
  • What does it offer

What does it offer

  • Formatting
  • Navigation
  • Assistance
  • Debug
  • Eclipse integration

Formatting

  • It is simply an indenter
    • It is configurable
  • It is available as single project
    • It is a rock

Formatting

  • Formatter settings can be attached to a project
    • Everybody working on a project uses the good one
  • Eases collaborative work

Assistance

  • Introducing a type system
  • Integrating documentation
  • Embracing environments

Assistance

Type system

  • Why?
  • Any example?
  • How is it done?

Assistance

Type system

Why?

  • It just bootstraps everything
  • It enable to focus on valuable completion
    • Minimize ackwards proposals
  • We like our Lua flexible
  • Flexible is hard for IDEs

Assistance

Type system

Any example?

  • I have two of them:
    • functions
      • What do they return?
    • tables
      • Which field is code assistance worthy?
      • What is the type or their fields?

Assistance

Type system

Any example?

colorer = function(x)
  local t = def(x)
  t.color = '#ddd'
  return t
end

-- So now, what's a good completion proposal?
local colored = colorer( somevalue )

Assistance

Type system

How is it done?

  • Documentation language
  • Comment prefixed annotations
  • Inference
  • Indeed: compatible with all Lua 5.1 interpreters

Assistance

Type system

How it is done: sample

---
-- @type coloredtable
-- @field #string result

--- @return #coloredtable
colorer = function(x)
  local t = def(x)
  t.color = '#ddd'
  return t
end

-- Now we know
local colored = colorer( somevalue )

Assistance

Type system

How is it done: another sample

---
-- @type coloredtable
-- @field #string result

colorer = function(x)
  local t = def(x)
  t.color = '#ddd'
  return t
end

local colored = colorer( somevalue ) -- #coloredtable

Assistance

Type system

Integrating documentation

  • Describes your code
    • In a way both humans and computers can understand
  • Can describe:
    • Modules
    • Libraries
    • Environments

Assistance

Type system

Integrating documentation

Environments?

  • We came with the concept of Execution Environment (EE)
    • It is the description of your application runtime
  • Convenient for:
    • Third party: No need to deliver source code
    • Frameworks: Explain how and why of some specifics
    • C: When commented right, you have completion on it

Assistance

Type system

Integrating documentation

It is open

  • LuaDocumentor, our documentation generator is
    • A single project
    • Available from command line
  • You can write your own EE
    • You can attach it to your project

Debug

Debug

  • Demo
    • Out of the box
    • Formatter
    • Locals & globals
    • LuaJIT

Eclipse integration

You can benefit from many Eclipse projects form LDT:

  • EGit
  • Mylyn
  • CDT

Would you use LDT?

Questions?

Merci